having trouble with the drag on my rocket projectile
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Write a double “for”-loop which cycles over 5 values of alpha from [0.7, 1.3] and 5 values of beta from [0.7 and 1.3], running the simulation 25 times (by calling sim)
? Each pass through the loop should plot the control signal uRocket , and the resultant output yRocket . Use subplot so that the control signal uRocket is in one axes, and the output yRocket is in a separate axes. ? As before, use hold on in the loop (and hold off afterwards) so that all 25 plots are in each figure window. This brute-force simulating over sweeps-of-values for uncertain parameters often called a “Monte Carlo” simulation.
my template: AlphaVals = linspace(0.7,1.3,5); BetaVals = linspace(0.7,1.3,5); % for ... for i=1:3 for j=1:3 ?? % for ... % Define parameters % sim(....) % end % end subplot(2,1,1); hold off subplot(2,1,2); hold off
1 Kommentar
Antworten (1)
Anh Tran
am 8 Sep. 2017
Hi Fiona,
You should not expect the MATLAB Answers community to give you an answer to your homework assignment.
You may want to consider using set_param function, which sets the parameter to a specified value on the block you want before running "sim()".
Also, in your template, each for-loop should iterate 5 times instead of 3.
Good luck!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Event Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!