Como se evalúa y grafica una función en App Designer

3 ビュー (過去 30 日間)
ANDRÉS MAURICIO DÍAZ BELTRÁN
ANDRÉS MAURICIO DÍAZ BELTRÁN 2021 年 3 月 16 日
回答済み: Asvin Kumar 2021 年 3 月 19 日
Tengo mi codigo asi
Quiero evaluar esta funcion "sign(cos(2*pi*x))"
funcion =@(x) eval(app.FxEditField.Value);
f = funcion;
maxn = app.HarmonicsSpinner.Value;
xmin = str2double(app.StartEditField.Value);
xmax = str2double(app.EndEditField.Value);
x = linspace(xmin, xmax, 100);
y = polyval(f,x);
plot(app.UIAxes,x,y);
app.UIAxes.XLim = [xmin, xmax];

回答 (1 件)

Asvin Kumar
Asvin Kumar 2021 年 3 月 19 日
y = f(x);
This should work.
Esto debería funcionar (Spanish from Google Translate)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by