What is wrong with the following code using ezplot?

조회 수: 1 (최근 30일)
Arvind Ganesh
Arvind Ganesh 2017년 2월 16일
답변: Star Strider 2017년 2월 16일
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.

답변 (1개)

Star Strider
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.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by