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!