Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a function, myProd(), that takes two arguments, x and y, and multiplies t

ID: 3585016 • Letter: C

Question

Create a function, myProd(), that takes two arguments, x and y, and multiplies the two arguments together then adds 14 to the result. Finally, divide the sum by two and return as z

I cannot come up with a solution for the above question, Could I get an explanation on how to approach and solve this problem.

Thank you,

I) Create a function, myProd), that takes two arguments, r and y, and multiplies the twoarguments together then adds 14 to the result. Finally, divide the sum by two and return as . Include help in your function.

Explanation / Answer

myProd2.m

function z = myProd2(x,y)

global result;

result=(x*y); %instead of these 3 line we can do in a single line program like
result=result+14; % z=((x*y)+14)/;
result=result/2; %
  
z=result; %whatever the variable which we want to return,that variable has to be

%defined beside the function like ex:function 'z'

end

main.m

myProd2(3,4)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote