Question
Question 1: Assume that we want to create a vector of increasing integer values from min to max. We will write a function called creatvec
Question 1: Assume that we want to create a vector of increasing integer values from min to max. We will write a function called creatvec that receives two input arguments, min and max and returns a vector with values from min to max in steps of 1.
Question 2: consider the following scheme which maps an integer quiz grade to a corresponding letter grade: 9 or 10 is an A 8 is a B 7 is a C 6 is a D Anything below 6 is an F Write a function called letgrade which receives an integer quiz grade and returns a corresponding letter as per the scheme above. Also the function returns the letter X if the quiz grade is not valid. This can be implemented with if-else statements.
Question 3: Implement the function in Question 2 using switch statement
Question 4: In many applications, it is useful to determine whether numbers in a matrix are positive, zero or negative. Write a Matlab function called signum with input matrix and the function should outputs 1 if the matrix element is positive, 0 is the matrix element is 0 and -1 if the matrix element is negative.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started