having trouble with the drag on my rocket projectile
1 次查看(过去 30 天)
显示 更早的评论
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 个)
Anh Tran
2017-9-8
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!