Error with Loop Martix formation
显示 更早的评论
I have been trying to alter this code so that if it is a bumpy road 4s or 10s it will form 1x201 martix beginning at t=0 and ends at t=T and them solve the y_R equation
T= both 10s bumpy road and 4s single bump
L= 6;
g=9.81;
V=35;
y_0=10;
w_R=(2.*pi.*V)/L;
yfail=0;
for y=1:3
Road=input('Enter the simulation type as a number (1=bumpy road, 2=single bump)');
if Road==1
fprintf('10s bumpy road\n')
Y_R=y_0.*.5.*sind(w_R.*t);
elseif Road==2
fprintf('4s single bump\n')
Y_R=y_0.*-1;
else
fprintf('Simulation type is not recognized. The program stops.Rerun the program again.\n')
yfail=yfail+1;
end
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!