Consider a user-defined function, which takes 3 scalar input values. The functio
ID: 3775228 • Letter: C
Question
Consider a user-defined function, which takes 3 scalar input values. The function file returns 1 scalar output, which is calculated as the first value multiplied by the second value plus the third value. For example, entering 2. 3. and 4. will result in the value of 10 being returned to the command window (because 2 times 3 + 4 = 10). In the box below, write a MATLAB function file, named my file .m. using the following variable names: i n1, i n2, i n3, and out. How would you type at the command prompt to get the response shown in the command window below? Note that this interaction corresponds to the numerical example described above. output - 10 Submission: 1 function m-tile, printout of your command window.Explanation / Answer
function f1 = am()
a=input('enter the first number ');
b=input('enter the second number ');
c=input('enter the third number ');
x=a+b
x=x+c
end
First save the file with same function name as here am.m
then call the function using terminal as
f1=am()
It will solve your problem,