How can I differentiate in app designer?

2 ビュー (過去 30 日間)
Tyler
Tyler 2023 年 3 月 22 日
回答済み: Eric Delgado 2023 年 3 月 22 日
Hello, I am unable to differentiate a function of x in the app designer specifically. I can do so in the base command window, yet I run into issues trying to do so in the app designer. The app returns with several seemingly random values. I have my code posted below. Any help is greatly appreciated. For context, I am trying to create an app that will differentiate any function of x, and later I plan to have it evaluate both graphs at a given point of x.
function ExecuteButtonValueChanged(app, event)
syms x
f = app.FxEditField.Value;
g=diff(f);
fplot(app.graph, f);
fplot(app.first_deriv,g);
end

採用された回答

Eric Delgado
Eric Delgado 2023 年 3 月 22 日
You missed the string to symbolic expression convertion...
% Instead of:
f = app.FxEditField.Value;
% Try:
f = str2sym(app.FxEditField.Value);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by