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!