Question: The code for a MATLAB function is provided below. if input1 = 10 and input2 = 1, what will be the final value of

The code for a MATLAB function is provided below. if input1 = 

The code for a MATLAB function is provided below. if input1 = 10 and input2 = 1, what will be the final value of w2 just before the function ends and returns the ouput values? function [cost,steps] = WhileFunction(input1,input2) w1 = input1; w2 = input2; steps = 0; while(w1w2) w1w1-1; w2 = w2+2; steps = steps+1; if w24 break end end cost input1*input2;

Step by Step Solution

3.39 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Given the provided MATLAB function if input1 10 and inpu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!