フィルターのクリア

How can I use inputdlg() to store multiple variables and then use those variables in equations for later?

1 回表示 (過去 30 日間)
Variables = inputdlg(["m","b","k","x1","x2","F","w0"])
Values = str2double(Variables{:})
l = b/2
w = sqrt(k/m)
wc=sqrt(w^2-l^2)
r1=-l+sqrt(l^2-w^2)
r2=-l-sqrt(l^2-w^2)

採用された回答

Stephen23
Stephen23 2021 年 4 月 28 日
編集済み: Stephen23 2021 年 4 月 28 日
>> C = inputdlg(["m","b","k","x1","x2","F","w0"])
C =
7×1 cell array
{'1.2'}
{'2.3'}
{'3.4'}
{'4.5'}
{'5.6'}
{'6.7'}
{'7.8'}
>> C = num2cell(str2double(C));
>> [m,b,k,x1,x2,F,w0] = deal(C{:})
m =
1.2000
b =
2.3000
k =
3.4000
x1 =
4.5000
x2 =
5.6000
F =
6.7000
w0 =
7.8000
>>

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by