input a function as a user input

3 ビュー (過去 30 日間)
Tony Montgomery
Tony Montgomery 2014 年 10 月 18 日
回答済み: Orion 2014 年 10 月 18 日
Here is what i need to do. I have to input the interval, number of interpolation points, and 4 functions. I need to then create chebyshev points, and iterpolate the functions. What I need help with is how do I create a function from a user input so I can evaluate at the two different intervals.
example on function is exp(-x) f = input('enter function: ') this is what i have, but what i want is to make this a fucntion
f = inline@(input('enter function: ')) but this wont work. what am i doing wrong?

回答 (1 件)

Orion
Orion 2014 年 10 月 18 日
Hi,
you should try to use inputdlg , which creates a basic gui easy to use and you can specify default values (or string exp(x) ).
this way, in one gui, on ask for the interval, number of interpolation points, and 4 functions.

カテゴリ

Help Center および File ExchangeFunction Creation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by