2d plot for imaginary

2 次查看(过去 30 天)
Gun
Gun 2011-2-25
Sorry for the trouble.I have a question to ask.Below is the code that i have written:
x4 = 0:pi/30:2*pi; % x vector, 0 <= x <= 2*pi, increments of pi/30
x4a=(137.*267.^(1/2).*111819872067690549716262153787.^(1/2).*1i.*(71289 - 2500.*x4^2).^(1/2))./785298692348313600 - (748846716930964699.*x4)./15705973846966272;
y4a=-sqrt(5.34^2-x4a^2);
plot(x4,x4a)
The problem is whenever i simulate it,they are saying Error using ==> mpower Inputs must be a scalar and a square matrix.
I have already put the . and even the imaginary part i have put 1i.What is wrong with it?
Thank you.

采纳的回答

the cyclist
the cyclist 2011-2-25
As you seem to have remembered in some places, but not others, you need ".^" to do element-wise raising to a power. Correcting this error in two places gives:
x4 = 0:pi/30:2*pi; % x vector, 0 <= x <= 2*pi, increments of pi/30
x4a=(137.*267.^(1/2).*111819872067690549716262153787.^(1/2).*1i.*(71289 - 2500.*x4.^2).^(1/2))./785298692348313600 - (748846716930964699.*x4)./15705973846966272;
y4a=-sqrt(5.34^2-x4a.^2);
plot(x4,x4a)
That code runs, but gives a warning about ignoring imaginary parts of your complex input. Maybe you can sort that out yourself?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by