cartesian to polar?
2 ビュー (過去 30 日間)
古いコメントを表示
i have tried to turn my values into polar (I need the angle of Ztot) but it's giving me the wrong value. where is my error?
C1Z = -1/(w*C1*1i);
C2Z = -1/(w*C2*1i);
LZ = w*L*1i;
Ztot = 1/((1/(C1R + C1Z)) + (1/(C2R + C2Z)) + (1/(LZ + Rw +Rsns)));
mag = abs(Ztot);
theta = (angle(Ztot));
real = mag;
imag = theta;
[th,r] = cart2pol (real,imag);
1 件のコメント
回答 (3 件)
Walter Roberson
2012 年 6 月 5 日
You indicate that you need the angle of Ztot, but you seem to already be calculating that and placing it in theta. And then you are using that angle as if it was a cartesian coordinate ?? Your calculations look to me more like you have polar coordinates that you want to translate to cartesian ?
0 件のコメント
katerina jablonski
2012 年 6 月 5 日
1 件のコメント
Walter Roberson
2012 年 6 月 5 日
You can display values to the command window using disp() or fprintf(). You can display simple messages "pop-up" using msgdlg() and related functions. You can display text data in a user interface control area using uicontrol() or uitable(). You can display text data in a graphic drawing area using text(). You can plot lines in a graphic drawing area using plot() or line(). You can plot a polar coordinate graph in a graphic drawing area using polar()
katerina jablonski
2012 年 6 月 5 日
2 件のコメント
Honglei Chen
2012 年 6 月 5 日
I don't quite get your question. You said you need the angle of Ztot, why isn't it just angle(Ztot)?
Walter Roberson
2012 年 6 月 5 日
Ztot = ((1/(C1R + C1Z)) + (1/(C2R + C2Z)) + (1/(Rw + Rsns + LZ)))^(-1);
Zmag = abs(Ztot);
Zangle = angle(Ztot); %This is the angle in radians
Zdeg = Zangle * 180/pi; %and in degrees if you need that
Zcos = cos(Zangle); %cos of angle, not angle itself
参考
カテゴリ
Help Center および File Exchange で Polar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!