how to print (function of x) in matlab ?

11 visualizaciones (últimos 30 días)
sawsan marz
sawsan marz el 16 de Nov. de 2018
Respondida: madhan ravi el 17 de Nov. de 2018
I want to print out the function I entered, for example I entered y=x.^4;
I want the matlab to calculate it and print it to me in term of x.
y=2x + 3x.^2 + ...
how can I do that ?
  2 comentarios
Adam Danz
Adam Danz el 16 de Nov. de 2018
Image Analyst
Image Analyst el 16 de Nov. de 2018
How are you deriving that quadratic equation from the 4th order equation?
Why can't you just use input() to get the string and use fprintf() to "print out the function I entered"?
userResponse = input('Enter the formula : ', 's');
fprintf('%s\n', userResponse);
See
Enter the formula : y = x^4
y = x^4

Iniciar sesión para comentar.

Respuestas (1)

madhan ravi
madhan ravi el 17 de Nov. de 2018

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by