??? Error using ==> mpower Matrix must be square.
12 次查看(过去 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.
0 个评论
采纳的回答
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
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)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!