What is wrong with the following code using ezplot?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Star Strider
le 16 Fév 2017
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 commentaires
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!