Curl function outputting -inf and NaN
2 次查看(过去 30 天)
显示 更早的评论
Hello All,
I have a 2-D velocity field I am trying to calculate the curl of. My input
curlX=curl(Y,Z,V,W);
and it gives me a matrix of a bunch of -inf, inf and NaN.
if I input just curlX=curl(V,W) then it gives me a result for curl but not on the correct coordinate system. Can someone please help me with this?
-Spencer
采纳的回答
Andrew Newell
2011-6-8
If quiver works but not curl, your coordinates may not have the correct form. They have to be monotonic, as if set up by meshgrid.
更多回答(3 个)
Sean de Wolski
2011-6-8
Apparently you're dividing a positive number by zero (inf), a negative number by zero (-inf) and zero by zero (nan). What does your data look like?
0 个评论
Spencer
2011-6-8
1 个评论
Andrew Newell
2011-6-8
Extra details for your question should be included as comments (like this one) or edits to your original question.
Spencer
2011-6-8
1 个评论
Sean de Wolski
2011-6-8
MATLAB works in double precision so it shouldn't have issues at 1e4. Unless you're dividing a very large number by 1e4.
Even:
2e200/1e4
doesn't go to inf.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!