Looping while changing integer
显示 更早的评论
Hello
nu=42
roll=-0.01-0.002*nu
pitch=0.01+0.002*nu
yawn=0.005+0.002*nu
Wx=0.0002+0.0001*nu
Wy=0.0003+0.0001*nu
Wz=0.0004+0.0001*nu
i have to loop nu 42 times and each time roll,pitch yawn, wx wy wz should change. Basically there should be 42 of each of them.I tried foor loop but it didnt work
max_nu = 42;
double roll[max_nu];
double pitch[max_nu];
double yawn[max_nu];
double Wx[max_nu];
double Wy[max_nu];
double Wz[max_nu];
for nu = 1; nu <= max_nu; nu=nu+1;
roll=-0.01-0.002*nu;
pitch=0.01+0.002*nu;
yawn=0.005+0.002*nu;
Wx=0.0002+0.0001*nu;
Wy=0.0003+0.0001*nu;
Wz=0.0004+0.0001*nu;
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!