Looping while changing integer
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!