how can i use slice for symbolic functions?

4 次查看(过去 30 天)
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