Borrar filtros
Borrar filtros

Defining values into zeros matrix

1 visualización (últimos 30 días)
Ilhami Alp Silahtaroglu
Ilhami Alp Silahtaroglu el 5 de En. de 2021
Comentada: Sriram Tadavarty el 5 de En. de 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

Respuesta aceptada

Sriram Tadavarty
Sriram Tadavarty el 5 de En. de 2021
Hi,
You can directly execute
q= 0:1:360;
s4=[(0.096.*cos(q))-(0.168.*sin(q))]
Regards,
Sriram
  3 comentarios
Ilhami Alp Silahtaroglu
Ilhami Alp Silahtaroglu el 5 de En. de 2021
@Sriram Tadavarty Thanks for your help, how can i write it in for loop for q=0:1:360
Sriram Tadavarty
Sriram Tadavarty el 5 de En. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by