having trouble with the drag on my rocket projectile

조회 수: 1 (최근 30일)
Fiona Xie
Fiona Xie 2017년 9월 5일
편집: Fiona Xie 2017년 9월 14일
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
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!

카테고리

Help CenterFile Exchange에서 Signal Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by