필터 지우기
필터 지우기

Mathematical calculations on input equation

조회 수: 3 (최근 30일)
Mohamed ahmed
Mohamed ahmed 2016년 11월 28일
댓글: Steven Lord 2021년 3월 11일
I want to write a program where user should be able to enter equation function of 1 variable. such as sin(t)-2t , but this equation is used in further calculations but i can't make this because the type of it is string. how can i solve this problem or change the type of input data to make mathematical calculations ?

답변 (2개)

bio lim
bio lim 2016년 11월 28일
What do you mean by function? Is it simply asking for a numerical input? If so,
f=input('enter input num\n')
  댓글 수: 4
Patrik Matta
Patrik Matta 2021년 3월 11일
Hi, I would like user to input function i.e. x^2 + 3*y^3 and then ask user for the value of x and y and get the value of the function for x and y. I have been looking foor an advice on various sites but nothing has worked for me. I have MATLAB R2020b.
Steven Lord
Steven Lord 2021년 3월 11일
Use str2func. See bio lim's comment from November 28, 2016 for an example.

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


prinesh patel
prinesh patel 2020년 5월 6일
how can i get this equation on matlab and then get the answer or any value of (t)
q(t)= (6.25* 10^9)/(t+500)^3

Community Treasure Hunt

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

Start Hunting!

Translated by