필터 지우기
필터 지우기

Convert ezmesh to fmesh

조회 수: 3 (최근 30일)
CL
CL 2021년 12월 9일
댓글: KSSV 2021년 12월 10일
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?

답변 (1개)

KSSV
KSSV 2021년 12월 9일
편집: KSSV 2021년 12월 10일
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
CL
CL 2021년 12월 10일
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 2021년 12월 10일
You can specify the intervel for x and y. Edited the code.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by