Plotting simple function with App Designer

Hello! I'm a beginner and I was wondering how can I build a GUI where I can insert a simple function and then I can plot it.
My final goal in one month will be to create a GUI that represents a Fourier transrom and how it changes when I change the angle offset, amplitude and so on.
any suggestions/tutorial?
Thank you

1 件のコメント

Agnish Dutta
Agnish Dutta 2019 年 3 月 18 日
You can use MATLAB appdesigner to build GUIs.
The following page will give you an overview of the different components of appdesigner and their properties:
In the appdesigner window, components can be dragged and placed in the main panel (which is a UI Figure object).
Next, you'll need to know how to manipulate the different objects and their properties using Callbacks. Callbacks are basically functions that are executed when certain event/s are triggered such as a button being pushed or a slider being moved. The following explains the same in detail:
Coming to the specific question which is about creating a GUi that plots a function, the following code may be used:
syms x; % Create a symbolic variable 'x'.
y = sin(x); % Create another variable 'y = sin(x)'.
fig1 = uifigure; % Create a uifigure object.
ax1 = uiaxes(fig1); % Create a uiaxes object with fig1 as its parent.
fplot(ax1, x, y); % Plot x vs y on the uiaxes object.
This will generate the plot on a GUI programmatically. The same can be done via appdesigner. You'll need a means to import data into your app though. I suggest using the uigetfile function. It return the file and it's path, that can be selected from a dialogue box.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2018b

質問済み:

2019 年 3 月 15 日

コメント済み:

2019 年 3 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by