It is a curl error or I am using it wrong?

2 ビュー (過去 30 日間)
Alberto
Alberto 2014 年 9 月 5 日
回答済み: Alberto 2014 年 10 月 18 日
Hi, I just want to graph the curl of this vector field:
F(x,y)=-2x ay % just have y direction not x.
Manually the curl gives me: -2 az, but when using the curl function in matlab it gives me -1 (a constant plane in z=-1), why? It suppose to give me a constant plane in z=-2.
code:
[x,y]=meshgrid(0:0.1:5, 0:0.1:5);
Fx=0.*x;
Fy=-2.*x;
rot=curl(x,y,Fx,Fy);
mesh(x,y,rot)

採用された回答

Harshad Deshmane
Harshad Deshmane 2014 年 9 月 29 日
You might be using the wrong output of the “curl” function to create the mesh plot. Calling “curl” with only one output argument gives you the curl angular velocity and not the curl z-component, which is what you need to get the mesh plot. You can refer to the documentation page for “ curl " for more information.
I suggest making the following changes:
>> [curlz, cav] = curl (x, y, Fx, Fy);
>> mesh (x, y, curlz)
I think this should resolve your issue.

その他の回答 (1 件)

Alberto
Alberto 2014 年 10 月 18 日
yes.. thank you. It worked. Didn't notice the others 3 parameter of the curl function. I though it was similar than divergence, but now I remember curl give vector as result..

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by