Do I need symbolic math toolbox to graph a function such as f(x)=ln(x) or f(x, y)=y^2/x
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Emilia
el 7 de Nov. de 2015
Respondida: John BG
el 10 de Mzo. de 2017
I just bought matlab and while processing data works well I cannot find how to graph functions from R to R for instance. Is it the case that I need to buy symbolic math toolbox in order to be able to do these graphings?
0 comentarios
Respuesta aceptada
Stephen23
el 7 de Nov. de 2015
Editada: Stephen23
el 7 de Nov. de 2015
There is no need for the symbolic toolbox for such simple functions. Try this:
>> X = 0:0.1:3;
>> Y = log(X);
>> plot(X,Y)
Or your second example:
>> [X,Y] = meshgrid(0:0.1:2,1:5);
>> Z = Y.^2./X;
>> surf(X,Y,Z)
3 comentarios
Stephen23
el 7 de Nov. de 2015
Editada: Stephen23
el 8 de Nov. de 2015
You pick those numbers to suit your needs: what range do you want to plot, and with how many points? The introductory tutorials describe how to make vectors of values:
And for more detailed info:
Tip use your favorite internet search engine to search the MATLAB documentation. Half of the questions we answer here are solved by simply reading the documentation.
Walter Roberson
el 8 de Nov. de 2015
Additionally:
If you had an expression in symbolic form because you were using the Symbolic toolbox, then you would still need to select particular ranges to plot it over. The plot routines cannot plot symbolic expressions directly: they can only plot the results of substituting in particular values into symbolic expressions and by so doing getting a numeric result.
You may also wish to look at ezplot()
Más respuestas (1)
John BG
el 10 de Mzo. de 2017
Hi Emilia
if it's about just plotting a function, there is a new function that does not require the symbolic Tool box called fplot
fplot(@(x) log10(x))

.
the same applies to fsurf, no need for the previous mesh declaration
fsurf(@(x,y) sin(x)+cos(y),'lines','none')
.

'
the field lines=none is optional
mesh also has a new fmesh
if you find this answer useful would you please be so kind to mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help solving your question,
please click on the thumbs-up vote link,
thanks in advance
John BG
0 comentarios
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!