Question: What will be displayed on the screen when running the MATLAB code below? Please explain years = 0 ; savings = 5 0 0 0

What will be displayed on the screen when running the MATLAB code below? Please explain
years =0;
savings=5000;
goal =200000;
rate =1
while savings goal
savings=savings+savings*rate;
years=years +1 ;
if years >5
rate = rate +1;
end
end
fprintf('$%0.2f was saved over %d years.
',savings,years)
 What will be displayed on the screen when running the MATLAB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!