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!