How can I differentiate in app designer?
조회 수: 9 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!