Error on phase diagram
2 次查看(过去 30 天)
显示 更早的评论
I am having a hard time getting this phase diagram to work it is suposed to be a vortex patterin around the origin and im getting some weird results for this.
The error I am getting is
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 2.040317e-19.
> In PhasePortrait (line 19)
function PhasePortrait()
x=[-1:0.05:1];
y=[-1:0.05:1];
m=length(x);
n=length(y);
xc=zeros(m,n);
yc=zeros(m,n);
for i=1:m
for j=1:n
xc(j,i)=y(j);
yc(j,i)=((((-4*129944)/601)*x(i))-(((4*6000/601))*y(j)))/100;
end
end
figure (1)
plot(x,0*x,':k')
plot(0*y,y,':k')
arrow=sqrt(xc.^2 + yc.^2);
quiver(x,y,xc./arrow,yc/arrow,0.5,'b')
xlim([min(x),max(x)])
ylim([min(y),max(y)])
hold on
grid on
axis tight
0 个评论
采纳的回答
Chunru
2021-8-2
x=[-1:0.05:1];
y=[-1:0.05:1];
m=length(x);
n=length(y);
xc=zeros(m,n);
yc=zeros(m,n);
for i=1:m
for j=1:n
xc(j,i)=y(j);
yc(j,i)=((((-4*129944)/601)*x(i))-(((4*6000/601))*y(j)))/100;
end
end
figure (1);
plot(x,0*x,':k');
hold on % hold on here
plot(0*y,y,':k')
arrow=sqrt(xc.^2 + yc.^2);
% ./ instead of / for yc
quiver(x,y,xc./arrow,yc./arrow,0.5,'b')
xlim([min(x),max(x)])
ylim([min(y),max(y)])
%hold on
grid on
axis tight
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!