Combine multiple input into a single command
1 次查看(过去 30 天)
显示 更早的评论
How do i combine multiple input into a single command instead of repeating the following commands
e.g. x0= 0 to 10
if true
x1=1;
delta_desired=interp1(x,y,x1);
display(delta_desired)
%Determine the stress value(N/m^2) at desired location
stress1=(delta_desired/(2*pi))*f_sigma/t;
display(stress1)
x2=2;
delta_desired2=interp1(x,y,x2);
display(delta_desired2)
%Determine the stress value(N/m^2) at desired location
stress2=(delta_desired2/(2*pi))*f_sigma/t;
display(stress2)
end
4 个评论
per isakson
2014-3-8
编辑:per isakson
2014-3-8
"index must be a positive integer or logical": Matlab is one-based; i.e. indices start with 1. Period! Cleve Moler once propose to add "+1".
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stress and Strain 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!