hold on is not working
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
The graphs clears up when plotting u,v. It does not hold on.
[x,y]=meshgrid(0:.5:4,0:.5:4);
m=(y-1)*(x+2);
L=sqrt(1+m.^2);
quiver(x,y,1./L,m./L);
 hold on
f=@(u,v)(v-1)*(u+2);
[u,v]=ode45(f,[0 5],3);
plot(u,v)
댓글 수: 0
답변 (1개)
  DGM
      
      
 2021년 4월 28일
        
      편집: DGM
      
      
 2021년 4월 28일
  
      There's nothing wrong with hold on.  Pay attention to the range of the data.
The quiver plot has a y range of about [-1 5], whereas the plot of u,v spans [3 12E9].  The quiver plot is reduced to a line.
I don't know why you'd be doing a quiver and line plot in the same axis anyway.  Just use a subplot or something. 
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

