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

12 visualizaciones (últimos 30 días)
Mariela Flores
Mariela Flores el 7 de Oct. de 2017
Respondida: aref mero el 8 de Oct. de 2017
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.

Respuesta aceptada

James Tursa
James Tursa el 7 de Oct. de 2017
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);

Más respuestas (1)

aref mero
aref mero el 8 de Oct. de 2017
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)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by