Effacer les filtres
Effacer les filtres

Convert ezmesh to fmesh

3 vues (au cours des 30 derniers jours)
CL
CL le 9 Déc 2021
Commenté : KSSV le 10 Déc 2021
I have an old piece of code that uses ezmesh:
h=ezmesh(@(x,y)v1(1)*x+v2(1)*y,... % funx
@(x,y)v1(2)*x+v2(2)*y,... % funy
@(x,y)v1(3)*x+v2(3)*y,... % funz
[-1 1 -1 1 -1 1]); % interval
In version R2021b, the editor prompts a warning that says:
'ezmesh' is not recommended. With appropriate code changes, use 'fmesh' instead
But after I convert ezmesh to fmesh:
h=fmesh(@(x,y)v1(1)*x+v2(1)*y,... % function of x
@(x,y)v1(2)*x+v2(2)*y,... % function of y
@(x,y)v1(3)*x+v2(3)*y,... % function of z
[-1 1 -1 1 -1 1]); % interval
I get the following warning:
Error using fsurf (line xxx)
Invalid parameter '-1 1 -...'.
Error in fmesh (line xxx)
h = fsurf(varargin{:}, 'CalledForMesh');
Error in xxx (line xxx)
h=fmesh(@(x,y)v1(1)*x+v2(1)*y,... % function of x
Can someone help explain what the problem is?

Réponses (1)

KSSV
KSSV le 9 Déc 2021
Modifié(e) : KSSV le 10 Déc 2021
v1 = rand(3,1) ;
v2 = rand(3,1) ;
h=fmesh(@(x,y)v1(1)*x+v2(1)*y,... % funx
@(x,y)v1(2)*x+v2(2)*y,... % funy
@(x,y)v1(3)*x+v2(3)*y,... % funz
[-1 1 -1 1]); % interval
  2 commentaires
CL
CL le 10 Déc 2021
sorry I'm not getting this. Why did you only specify one inteval [-1,1] for x-axis and ignoreing y- and z-axis? In the image shown, x's axis has [-0.4,0.4], y's axis has [-0.5,0.5] and z's [-1.3,1.3] ... none of the axis shown inteval of [-1,1].
KSSV
KSSV le 10 Déc 2021
You can specify the intervel for x and y. Edited the code.

Connectez-vous pour commenter.

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by