Filter löschen
Filter löschen

Convert ezmesh to fmesh

3 Ansichten (letzte 30 Tage)
CL
CL am 9 Dez. 2021
Kommentiert: KSSV am 10 Dez. 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?

Antworten (1)

KSSV
KSSV am 9 Dez. 2021
Bearbeitet: KSSV am 10 Dez. 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 Kommentare
CL
CL am 10 Dez. 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 am 10 Dez. 2021
You can specify the intervel for x and y. Edited the code.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by