Working with array elements and structure

1 visualización (últimos 30 días)
Lucy
Lucy el 16 de Abr. de 2014
Comentada: Azzi Abdelmalek el 16 de Abr. de 2014
Hi, I am learning to use matlab, and have these simplified code;
K=12;
N=2;
phi_st=0;
delta_phi=30;
i=1:K;
phi(i)=phi_st+(i*delta_phi);
j=1:N;
phi_p=180;
phi_P=(phi_p)*(j-1);
Now my question is how do I compute
phi_1=phi(i)+phi_P;
The error am getting is "Error using + Matrix dimensions must agree."
Please assist me.thanks

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Abr. de 2014
replace k by K in
phi_P=(phi_p).*(k-1);
  2 comentarios
Lucy
Lucy el 16 de Abr. de 2014
So sorry.i made a mistake.its j, not k.thanks
Azzi Abdelmalek
Azzi Abdelmalek el 16 de Abr. de 2014
Check the sizes of phi(i) and phi_P, they are different

Iniciar sesión para comentar.

Categorías

Más información sobre Parallel Computing 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