필터 지우기
필터 지우기

No arrows in quiver plot

조회 수: 1 (최근 30일)
Elle
Elle 2013년 5월 13일
For some reason there are no arrows in my quiver plot just some weird marks. What am I doing wrong?
if true
clc; clear;
alpha = 0.6; beta = 0.4; rho = 2; gamma = 0.6; phi = 0.7; x = 400; s = 0.2;
l = 100; a = 0.3;
[l,a] = meshgrid(-10:1:10);
lend = NaN(size(l)); aend = NaN(size(l));
%calculate next point from each point
for i=1:length(l)
for j=1:length(a)
lEnd(i,j) = (gamma/rho)*l(i)^(alpha)*a(j)^(1-alpha)*x^(1-alpha);
aEnd(i,j) = s*l(i)^(beta+1)*a(j)^(phi)*x^(-beta) ;
end
end
%plot, arrow directions are changes
quiver(l,a,lEnd-l,aEnd-a,s)
end

답변 (1개)

David Sanchez
David Sanchez 2013년 5월 13일
set s=2 (for example), you are scaling the arrows to a very small size.
  댓글 수: 2
Elle
Elle 2013년 5월 13일
I changed it but it still doesn't do much. Also realized I was using s as one of the parameters and changed it to sp.
if true
clc; clear;
alpha = 0.6; beta = 0.4; rho = 2; gamma = 0.6; phi = 0.7; x = 400; sp = 0.2;
l = 100; a = 0.3;
%Control of meshgrid [l,a] = meshgrid(-10:2:10);
lend = NaN(size(l)); aend = NaN(size(l));
%calculate next point from each point
for i=1:length(l)
for j=1:length(a)
lEnd(i,j) = (gamma/rho)*l(i)^(alpha)*a(j)^(1-alpha)*x^(1-alpha);
aEnd(i,j) = sp*l(i)^(beta+1)*a(j)^(phi)*x^(-beta) ;
end
end
%plot, arrow directions are changes
quiver(l,a,lEnd-l,aEnd-a,2)
end
Youssef  Khmou
Youssef Khmou 2013년 5월 13일
hi, the arrows look fine, what is the issue?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by