Borrar filtros
Borrar filtros

how can i use slice for symbolic functions?

2 visualizaciones (últimos 30 días)
Moein
Moein el 1 de Oct. de 2014
Comentada: Mischa Kim el 1 de Oct. de 2014
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)

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by