Borrar filtros
Borrar filtros

Convert ezmesh to fmesh

3 visualizaciones (últimos 30 días)
CL
CL el 9 de Dic. de 2021
Comentada: KSSV el 10 de Dic. de 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?

Respuestas (1)

KSSV
KSSV el 9 de Dic. de 2021
Editada: KSSV el 10 de Dic. de 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 comentarios
CL
CL el 10 de Dic. de 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 el 10 de Dic. de 2021
You can specify the intervel for x and y. Edited the code.

Iniciar sesión para comentar.

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by