Vector plots by Quiver in MATLAB
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everyone,
I created a vector plot by Glyph in Paraview (using OpenFOAM), but couldn't able to plot the same using Quiver in MATLAB.
The plot was mentioned below (Glyph images) at different times (1 hour and 10 hours). The plane locations are different: x = 0.05m for 1 hour and x = 0.20m for 10 hours, where the vectors are initiated from the plane.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1336684/image.png)
In order to plot the similar results in MATLAB, I have discretized my equations clearly and coded it. When I type the command line,
quiver(x,y,u',v','AutoScaleFactor',0.2), I got the below image, which seems bit inapproriate when compared to above image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1336689/image.png)
Can someone help me, how to make it work in Matlab. I believe, I'm lagging some technique to solve by Quiver ?
Thank you
댓글 수: 0
답변 (1개)
KSSV
2023년 3월 26일
[X,Y,Z] = peaks(100) ;
[u,v] = gradient(Z) ;
w = sqrt(u.^2+v.^2) ;
pcolor(X,Y,w) ;
shading interp ; colormap(jet);
hold on
quiver(X,Y,u,v,'k')
If you want color on arrows try using: https://in.mathworks.com/matlabcentral/fileexchange/3225-quiverc?s_tid=ta_fx_results
참고 항목
카테고리
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!