how to print (function of x) in matlab ?

조회 수: 8 (최근 30일)
sawsan marz
sawsan marz 2018년 11월 16일
답변: madhan ravi 2018년 11월 17일
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
Adam Danz
Adam Danz 2018년 11월 16일
Image Analyst
Image Analyst 2018년 11월 16일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

madhan ravi
madhan ravi 2018년 11월 17일

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by