Question

Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following information: 1. Column 1: S
temperatures.txt 34.7114.34.7512,34,33,34,360,40,0006 34,4742,64.6931 6.4996,59.6849.64.1619. 34.9951,34,9892.5. Boom,35.0029

Matlab question
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Working code implemented in Matlab and appropriate comments provided for better understanding:

Here I am attaching code for these files:

  • getmarks.m
  • Task2.m

Source code for getmarks.m:

% Function for Task 2 : Final Marks
%
%
%INPUTS
%lab_m = total marks for lab
%ass_m = total assignment marks
%oth_m = total other marks
%exm_m = total exms marks
%
%
%OUTPUTS
%Final_m = final marks
%grade = final grade
%
%
%defines the function getmarks with 4 input arguments
%this function returns two values
function [ final_m, grade ] = getmarks(lab_m , ass_m , oth_m , exm_m)

%calculates the final marks of student
final_m = (0.25*(lab_m/100) + 0.1*(ass_m/10) + 0.15*(oth_m/15) + 0.5*(exm_m/100))*100;

%if else statement to determine which grade category the student belongs to
if final_m >= 80
  
grade = 'HD';
  
elseif final_m >= 70
  
grade = 'D';
  
elseif final_m >= 60
  
grade = 'C';
  
  
elseif final_m >= 50
  
grade = 'P';
  
else
  
grade = 'N';
  
end

Code Screenshots:

1 % Function for Task 2 : Final Marks 2 % 3 % 4 %INPUTS 5 %lab_m total marks for lab 6 %ass_m = total assignment marks 7 %othSource code for Task2.m:

% Task 2 : Final Marks
close all; clear all; clc;

%prompts the user for their student ID
usr_id = input('Welcome to Monash, please enter your student ID :');

%imports the data from ENG1060studentmarks.txt into a table
datum = importdata('ENG1060studentmarks.txt');

%gets the numeric data values in the form of a matrix
marks_table = datum.data;

%finds the row of where the inputted student id is
[ x, y ]= find(marks_table == usr_id);

%sums up the lab marks (column 2 to 11)
lab_total = sum(marks_table(x,2:11));

%gets the marks for assignment, others and exm
ass_total = marks_table(x,12);
oth_total = marks_table(x,13);
exm_total = marks_table(x,14);

%calls the function getmarks with the 4 in put arguments above
%function reutrn 2 values
[ total_marks, grade ] = getmarks(lab_total,ass_total,oth_total,exm_total);

%prints the final mark and grade
fprintf('your total mark is %3.0f, your grade is ',total_marks);
fprintf(grade);

Code Screenshots:

% Task 2 : Final Marks close all; clear all; clc; %prompts the user for their student ID usr_id = input(Welcome to Monash, p

Hope it helps, if you like the answer give it a thumbs up. Thank you.

% Task 2 : Final Marks close all; clear all; clc; %prompts the user for their student ID usr_id = input('Welcome to Monash, please

Add a comment
Know the answer?
Add Answer to:
Matlab question Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Task 5 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following...

    use Matlab to solve this problem, thank you Task 5 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following information: 1. 2, 3, 4, Column 1: Student ID Column 2-11: Lab marks (/10) worth 2% each (20% total of final grade) Column 12: Assignment mark (/10) worth 10% of the final grade Column 13: Exam mark (/100) worth 70% of the final grade a) Write a function that accepts a student's laboratory, assignment and exam marks as...

  • MATLAN Quiz 2 Create a MATLAB function that calculates the average of values in a vector that als...

    MATLAN Quiz 2 Create a MATLAB function that calculates the average of values in a vector that also drops the slowest values. Call this function average_drop(). The function must have a single input (the vector) and a single output (the average without the lowest score). 1. 2. Create a MATLAB program that asks the user to input grades for a student and calculates the final grade and letter grade. The user must enter 5 quiz grades (worth 50% of the...

  • python question 2. In a file called passfail.py, write a Python program to solve the following...

    python question 2. In a file called passfail.py, write a Python program to solve the following problem: Given a file students.txt with the following information for a stu dent: student number, average quiz mark, average assignment mark, midterm exam mark, and final exam mark (where each mark is recorded out of 100), de termine if the student has passed or failed based on the following information: • A student will pass the course if they have a passing mark (50%...

  • Question 5.[15 marks] [Chapters 7 and 8] Data from a random sample of a recent large second semester stage 2 statistics course (STATS 20x) were collected. Below is some information on the variabl...

    Question 5.[15 marks] [Chapters 7 and 8] Data from a random sample of a recent large second semester stage 2 statistics course (STATS 20x) were collected. Below is some information on the variables collected. Variable Grade The student's final grade for the course: A, B. C, D Pass Whether the student passed the course: Yes, No Programme The programme the student is enrolled in: BA, BCom BSc, Other Sex The student's sex: Female, Male ผhether the student regularly attended class:...

  • Write a grading program for the following grading policies:- a. There are two quizzes, each graded...

    Write a grading program for the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:- >90 A >=80 and <90 B...

  • Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a...

    Kindly solve this using C PROGRAMMING ONLY. 4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...

  • 2. In a file called passfail.py, write a Python program to solve the following problem: Given...

    2. In a file called passfail.py, write a Python program to solve the following problem: Given a file students.txt with the following information for a stu dent: student number, average quiz mark, average assignment mark, midterm exam mark, and final exam mark (where each mark is recorded out of 100), de termine if the student has passed or failed based on the following information A student will pass the course if they have a passing mark (50% or higher) for...

  • Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might...

    Many classes calculate a final grade by using a weighted scoring system. For example, “Assignments” might be worth 40% of your final grade. To calculate the grade for the Assignments category, the teacher takes the percentage earned on the assignments and multiplies it by the weight. So if the student earned a 90% total on the Assignments, the teacher would take 90% x 40, which means the student earned a 36 percent on the Assignments section. The teacher then calculates...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

  • PYTHON 3 Object Oriented Programming ***a9q3.py file below*** class GradeItem(object): # A Grade Item is anything...

    PYTHON 3 Object Oriented Programming ***a9q3.py file below*** class GradeItem(object): # A Grade Item is anything a course uses in a grading scheme, # like a test or an assignment. It has a score, which is assessed by # an instructor, and a maximum value, set by the instructor, and a weight, # which defines how much the item counts towards a final grade. def __init__(self, weight, scored=None, out_of=None): """ Purpose: Initialize the GradeItem object. Preconditions: :param weight: the weight...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT