# Can someone help me with this. I try my 101% but i always fail with GUI.

1 回表示 (過去 30 日間)
Mateja Sima 2022 年 6 月 3 日
コメント済み: John D'Errico 2022 年 6 月 3 日
Create program code in Matlab that launches a graphical user interface through which the user will be able to add, subtract, multiply and divide the matrix and scalar through the input fields of the entered matrix and scalar, and select one of the four buttons. Provide must prove. Print the result of the operation in the field on the graphical interface.
##### 2 件のコメントなしを表示なしを非表示
Sam Chak 2022 年 6 月 3 日
Can you at least show/share your 101% MATLAB code? It makes life easier to troubleshoot and modify the existing code.
John D'Errico 2022 年 6 月 3 日

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

### 回答 (2 件)

Mateja Sima 2022 年 6 月 3 日
while true
k = input ('Enter 1 to enter your own matrix, otherwise press 2:', 's');
k = str2double (k);
if ~ isnan (k)
break;
else
disp ('Only number counts !!!');
end
end
if k == 1
a = input ('Enter scalar value =');
A = input ('Enter production matrix =');
multiplication = A * a
division = A / a
subtraction = A-a
elseif k == 2
a = input ('Enter scalar value =');
n = input ('Enter value for number of species =');
m = input ('Enter value for number of columns =');
A = rand (n, m);
multiplication = A * a
division = A / a
subtraction = A-a
else
fprintf ('Re-enter parameter k. \ n')
end
##### 1 件のコメント-1 件の古いコメントを表示-1 件の古いコメントを非表示
Michael Van de Graaff 2022 年 6 月 3 日
You can use the code tool to format code
% the first button in the code portion of the toolbar for the box i'm
% writing in write now

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

Michael Van de Graaff 2022 年 6 月 3 日
the code you've provided (which you should put in youre question rather than your comment/answer, you can edit the question and add it any time) doesn't make a Graphical User Interface (GUI),
You should look up the App Designer, it's a tool to make GUIs. The app may have text boxes for you to input data, and a CallBack which is a function inside the app which then does things, like multply matrices.
Do not expect someone to walk you through each step.
to make a basic GUI that has a single edit field for a scalar input, see https://www.mathworks.com/help/matlab/ref/uieditfield.html
##### 1 件のコメント-1 件の古いコメントを表示-1 件の古いコメントを非表示
Mateja Sima 2022 年 6 月 3 日
Thanks.

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

### カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

### Community Treasure Hunt

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

Start Hunting!

Translated by