Defining values into zeros matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ilhami Alp Silahtaroglu
am 5 Jan. 2021
Kommentiert: Sriram Tadavarty
am 5 Jan. 2021
How can i define all s4 values in a FIRSTSPACE?
LOWERLIMIT = 1 ;
UPPERLIMIT = 360 ;
FIRSTSPACE=zeros(LOWERLIMIT,UPPERLIMIT);
for q=(0:1:360)
s4=[(0.096.*cos(q))-(0.168.*sin(q))]
end
0 Kommentare
Akzeptierte Antwort
Sriram Tadavarty
am 5 Jan. 2021
Hi,
You can directly execute
q= 0:1:360;
s4=[(0.096.*cos(q))-(0.168.*sin(q))]
Regards,
Sriram
3 Kommentare
Sriram Tadavarty
am 5 Jan. 2021
Using for loop is not apt here.
But, just in-case you only need it as such. Here is it:
LOWERLIMIT = 1 ;
UPPERLIMIT = 361 ;
FIRSTSPACE=zeros(LOWERLIMIT,UPPERLIMIT);
for q=(0:1:360)
FIRSTSPACE(q+1) = [(0.096.*cos(q))-(0.168.*sin(q))];
end
Regards,
Sriram
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!