create a GUI for my basic script

4 ビュー (過去 30 日間)
mabdorab
mabdorab 2016 年 12 月 7 日
コメント済み: Geoff Hayes 2016 年 12 月 8 日
This is my code
n = 30000;
R = zeros(n,3);
for k=1:n
R(k,:) = [poissrnd(0.0000407430680),poissrnd(0.000472626),poissrnd(0.002497495)];
end
columnSums = sum® A=columnSums(1) B=columnSums(2) C=columnSums(3) D= n-(A + B + C)
I want to create a GUI allowing the user to:
1. choose whether they wanted 'A' and/or,'B' and/or 'C'
2. change the value of 'n' in my code with like a scroll bar
3. the values 1 to 30000 represent the different people in my analysis. if a user wanted to know which person was creating the random values in the A,B,and C, how could I also add this to my GUI.
4. A button to allow the user to choose their desired value of 'n'
If help with doing any part of this can be explained I would really appreciate it. Please note I have not used the GUI on MATLAB before, but I am able to figure it out with some explanation. Would appreciate solution by tomorrow.
thanks in advance all

回答 (1 件)

Geoff Hayes
Geoff Hayes 2016 年 12 月 7 日
mabdorab - there are plenty of examples on how to create a GUI using MATLAB so start with one of them and go from there. Depending upon your version of MATLAB, I suggest that you use either the APP Designer or GUIDE. See Create Apps with Graphical User Interfaces in MATLAB for some tutorials.
  2 件のコメント
mabdorab
mabdorab 2016 年 12 月 7 日
編集済み: mabdorab 2016 年 12 月 7 日
I can't seem to figure out how to code it once i have designed it using the GUIDE.
I created a slider I have 4 push buttons to represent my 4 outcome options But i do not know where to code my data
Any help would be appreciated. I am completley clueless. My deadline is tomorrow :(
Geoff Hayes
Geoff Hayes 2016 年 12 月 8 日
Given that this is a homework assignment, you will need to show what you have tried before asking for an answer.

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

カテゴリ

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