Working with array elements and structure

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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2014년 4월 16일

0 개 추천

replace k by K in
phi_P=(phi_p).*(k-1);

댓글 수: 2

Lucy
Lucy 2014년 4월 16일
So sorry.i made a mistake.its j, not k.thanks
Check the sizes of phi(i) and phi_P, they are different

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2014년 4월 16일

댓글:

2014년 4월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by