이전 댓글 표시
Im trying to convert a vector O in radian into x-coordinate vector and y-coordinate vector but Im encountering the problem below.
??? Error using ==> mpower Inputs must be a scalar and a square matrix.
Error in ==> Untitled4 at 22 r=[(a*b)/sqrt((b*cos(O))^2+(a*sin(O))^2)]; % ellipse in polar coordinates
npanels=3;
a=1.25; %major axis
b=0.75; %minor axis
O=[pi-pi/(2*npanels):-pi/(npanels):pi/(2*npanels)]; %boundary points in radian
r=[(a*b)/sqrt((b*cos(O))^2+(a*sin(O))^2)]; % ellipse in polar coordinates
x=rcos(O); %x-coordinate
y=rsin(O); %y-coordinate
채택된 답변
추가 답변 (2개)
Walter Roberson
2011년 5월 8일
r=(a*b)/sqrt((b*cos(O)).^2+(a*sin(O)).^2);
Yoon Hong Ng
2011년 5월 8일
0 개 추천
댓글 수: 2
Paulo Silva
2011년 5월 8일
same thing add a dot before the operation mentioned on the error
./ instead of /
Yoon Hong Ng
2011년 5월 8일
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!