In Matlab write a function called exercise1 that works as fo

In Matlab write a function called exercise1 that works as follows:

         

          Typing [a, b, c]=exercise1(x)

         

returns the variables a, b, and c where a is the mode of x. You can use any previously defined MATLAB functions, including mean, median, and mode. Remember to use a separate m file called Lastname_Lab4_Ex1.m which is a copy of the file you saved as exercise.m.

Solution

x=[1 2 3 2 3 2];

%x=input(\'enter x values\'); //another way user input
Typing [a, b, c]=exercise1(x)
a=mode(x)
b=mean(x)
c=median(x)
end

In Matlab write a function called exercise1 that works as follows: Typing [a, b, c]=exercise1(x) returns the variables a, b, and c where a is the mode of x. You

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site