What is wrong with the following code using ezplot?
1 次查看(过去 30 天)
显示 更早的评论
syms u v
x= u^2+sin(v);
y= tan(v);
z= 1/(tan(u)+sin(v));
ezplot(@(u,v)tan(x)+y+sin(z)==0)
% I want a 2D plot of u and v from the parametrized equation.
0 个评论
回答(1 个)
Star Strider
2017-2-16
You have a two-variable equation. The ezplot and fplot functions plot one-variable equations. You have to change your function definitions and your function call in the ezcoutour or fcontour (or other mesh or surface plot):
syms u v
x = symfun(u^2+sin(v), [u,v]);
y = symfun(tan(v), v);
z = symfun(1/(tan(u)+sin(v)), [u,v]);
fcontour(@(u,v)tan(x(u,v))+y(v)+sin(z(u,v)))
This code works (and will work with ezcontour or fcontour with R2012a and later). However, the fcontour (and ezcontour) call throws this error:
Warning: Error updating FunctionContour.
Division by zero.
and produces no plot. I will let your sort that out.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!