how can i use slice for symbolic functions?

4 views (last 30 days)
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)

Accepted Answer

Mischa Kim
Mischa Kim on 1 Oct 2014
Edited: Mischa Kim on 1 Oct 2014
Moein, most likely you can use matlabFunction to convert the symbolic functions and then use function such as slice.
  2 Comments
Moein
Moein on 1 Oct 2014
Edited: Moein on 1 Oct 2014
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 on 1 Oct 2014
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!