Converting a string containing a function (t) to a useable variable.
古いコメントを表示
I'm using inputdlg to take user input and calculate and store the value.
This is what I was trying to do.
x = inputdlg('Enter Mathematical Equation')
t = [0:0.001:20]
z = str2double (x{1})
I need to be able to enter 20*cos(4*t) for instance and have the calculated result stored in the variable, but I can't seem to get any result or for matlab to recognize the variable entered even if its declared prior to the inputdlg. Simply arguments like 20*cos(20) properly converts and calculates. How would I go on about being able to use the function from the string.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!