??? Error using ==> mpower Matrix must be square.

8 次查看(过去 30 天)
hello everybody, I'm triying to create a graphic, but when I run the program, it gives me an error:
??? Error using ==> mpower Matrix must be square. Error in ==> ssssssssss at 5 y=1/sqrt((1-(x^2))^2+(2*xi*x)^2);
this is my code:
% code
clc;
xi=0;
x=0:0.01:5;
y=1/sqrt((1-(x^2))^2+(2*xi*x)^2);
plot(x,y)
Instead of using plot, I've tried SEMILOGY and LOGLOG but the message is the same.

采纳的回答

James Tursa
James Tursa 2017-10-7
You need to use the element-wise operators that have a dot in front of them instead of the matrix operators. So use this instead:
y = 1 ./ sqrt((1-(x.^2)).^2 + (2*xi*x).^2);

更多回答(1 个)

aref mero
aref mero 2017-10-8
for SP=1:20 E1=Q*F1; bug=bug+E1; % bug=bug+E1 end bug=0; for SP=1:20 E2=Q*F2; bug=bug+E2; % bug=bug+E2 end E=sqrt(E1^2+E2^2)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by