Create an app in MATLAB App Designer. Use a RadioButton Group to choose the different functions. When you choose one function it should be displayed in a graph in the app and the title should state which graph it is. the functions are sine,cosine,lnx

8 visualizaciones (últimos 30 días)
  3 comentarios
Sofie Önnemar
Sofie Önnemar el 25 de Sept. de 2020
I´m new to App Designer and not really sure where to start, with creating the code for each Radio Button.

Iniciar sesión para comentar.

Respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 25 de Sept. de 2020
Editada: KALYAN ACHARJYA el 25 de Sept. de 2020
Steps: (Or Refer any tutorial, please check in the MATLAB youtube channel)
1. Open MATLAB
2. Type the following in the command window
>> appdesigner
2. Just drag and drop all required blocks, chahe the texts as per requirements
4. Call Back activate (Right Click on the Radio Button Group)
5. Insert the following code, its just the if else condition
6. Run the code
SteselectedButton = app.yButtonGroup.SelectedObject;
x=1:0.05:100;
if app.sinxButton.Value
y=sin(x);
plot(app.UIAxes,x,y);
title(app.UIAxes,'y=sin(x)');
elseif app.cosxButton.Value
y=cos(x);
plot(app.UIAxes,x,y);
title(app.UIAxes,'y=cos(x)');
elseif app.xButton.Value
y=2*x;
plot(app.UIAxes,x,y);
title(app.UIAxes,'y=2x');
elseif app.lnxButton.Value
y=log(x);
plot(app.UIAxes,x,y);
title(app.UIAxes,'y=ln(x)');
else
y=exp(x);
plot(app.UIAxes,x,y);
title(app.UIAxes,'y=e^x');
end

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by