Course Solutions Uncategorized (Solved) : Hello Fairly New Matlab Confused Uses Commands Attached Code M Trouble Doesn T Give Output Q37395422 . . . .

(Solved) : Hello Fairly New Matlab Confused Uses Commands Attached Code M Trouble Doesn T Give Output Q37395422 . . . .

 

Hello, I am fairly new to MATLAB and am confused on the uses of”for” and “while” commands. Attached is the code I’m having troublewith (doesn’t give and output). Thanks so much in advance!

%%
total_coins=0;
for money=0:99
current_money=money;
number_q=0;
number_d=0;
number_n=0;
number_p=0;
  
while current_money>0
if current_money>=25
current_money=current_money-25;
number_q=number_q+1;
elseif current_money>=10
current_money=current_money-10;
number_d=number_d+1;
elseif current_money>=10
current_money=current_money-5;
number_n=number_n+1;
elseif current_money>=10
current_money=current_money-1;
number_p=number_p+1;
end
end
end
  
number_coins=number_q+number_d+number_n+number_p;
total_coins=total_coins+number_coins;
avg_coins=(total_coins)/(100);
fprintf(‘%2.2f’,avg_coins)

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 1 Set Differential Equations Describe Concentrations Cell Mass X Substrate S Glucose Produ Q33201238 . . . .(Solved) : 1 Set Differential Equations Describe Concentrations Cell Mass X Substrate S Glucose Produ Q33201238 . . . .

<p dir="ltr"><img src="../../../media.cheggcdn.com/media/959/9597f07a-e372-46c3-a7ae-e9c631c8f77d/image.png" alt="1. The set of differential equations that describe how the concentrations of cell- mass (x), substrate (s) (glucose) and product (P) (ethanol) change over time for a

(Answered) : Solution Contains 759 10 3 M Manganese Ii Acetate 149 10 2 M Zinc Nitrate Solid Sodium Car Q28095352(Answered) : Solution Contains 759 10 3 M Manganese Ii Acetate 149 10 2 M Zinc Nitrate Solid Sodium Car Q28095352

<p>A solution contains <strong>7.59×10-3</strong> M<strong>manganese(II) acetate</strong> and<strong>1.49×10-2</strong> M <strong>zincnitrate</strong>.<br/>Solid <strong>sodium carbonate</strong> is added slowly to thismixture.<br/><br/><strong>A.</strong> What is the <strong>formula</strong> of thesubstance that precipitates first?<br/></p><table><tbody><tr><td style="vertical-align:middle;">formula =</td><td style="vertical-align:middle;"/></tr></tbody></table><p><br/><br/><br/><strong>B.</strong> What is