how can i use slice for symbolic functions?

조회 수: 5 (최근 30일)
Moein
Moein 2014년 10월 1일
댓글: Mischa Kim 2014년 10월 1일
hi friends
as you know, for symbolic functions, we can not use formulas like plot, mesh, surf , ... and then we should use formulas like ezplot, ezmesh, ezsurf , ... but about the formula " slice " (for symbolic functions), what formula we sholud use? ezslice?!! (it doesn't exist)

채택된 답변

Mischa Kim
Mischa Kim 2014년 10월 1일
편집: Mischa Kim 2014년 10월 1일
Moein, most likely you can use matlabFunction to convert the symbolic functions and then use function such as slice.
  댓글 수: 2
Moein
Moein 2014년 10월 1일
편집: Moein 2014년 10월 1일
Hi Mischa
thanks a lot for your answer. i tried your answer but it errors i know my mistake: my code to draw slice, is incorrect let's solve it by an axample
for an example easier than my code, but like that, assume that i want to create slices for r(x,y,z) and r is symbolic function i use this code:
syms x y z;
r = x^2 + y^2 + z^2;
s = matlabFunction(r);
[x,y,z] = meshgrid(-2:.2:2,-2:.25:2,-2:.16:2);
xslice = [-1.2,.8,2]; yslice = 2; zslice = [-2,0];
slice(x,y,z,s,xslice,yslice,zslice)
colormap hsv
but it errors:
??? Error using ==> slice at 85 V must be a 3-D array.
what should i do? help me if you can
thanks a lot
Mischa Kim
Mischa Kim 2014년 10월 1일
If your function is readily available (as is the case above) you do not need to use the symbolic approach at all. See the answer to your duplicate question.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by