Problems plotting, and variables

조회 수: 8 (최근 30일)
ESTEFANIA RODRIGUEZ
ESTEFANIA RODRIGUEZ 2021년 8월 31일
댓글: ESTEFANIA RODRIGUEZ 2021년 8월 31일
Im creating a code so MU need to have 2 columns and "n" rows. (Column 1 and 2 are for storing solutions 1 and 2 (ns) respective.)
and also make a graph of MU with respect to theta, showing both solutions (solutions are in different scrpt)
BUT I got this error message "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side." MU(:,1)=th4-th3(:,ns);
CAN SOMEONE HELP ME PLS ?
So my code is :
ns=1; % Number of solution (ns)
MU(:,1)=th4-th3(:,ns);
MU(:,2)=th4-th3(:,ns);
ns=2;
%MU=th4-th3(:,ns);
MU(:,1)=th4-th3(:,ns);
MU(:,2)=th4-th3(:,ns)
figure
hold on
plot(th2,MU(:,1),'b.'); % (th2 is already calculated at the top of the code)
plot(th2,MU(:,2),'r-');
axis equal
xlabel('x')
ylabel('y')
title('Ángulo de Transmisión')
  댓글 수: 1
Ive J
Ive J 2021년 8월 31일
post some example values in th3 and th4.

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

채택된 답변

Image Analyst
Image Analyst 2021년 8월 31일
th4 does not have as many rows as th3. What does this show?
[rows3, columns3] = size(th3)
[rows4, columns4] = size(th4)
  댓글 수: 1
ESTEFANIA RODRIGUEZ
ESTEFANIA RODRIGUEZ 2021년 8월 31일
Thanks for ur comment!!! that made me found the mistake

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by