Azzera filtri
Azzera filtri

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

8 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

James Tursa
James Tursa il 7 Ott 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);

Più risposte (1)

aref mero
aref mero il 8 Ott 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)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by