How to run matlab script within GUI file then wait for the GUI input in the script ?

3 ビュー (過去 30 日間)
Nora Khaled
Nora Khaled 2020 年 1 月 21 日
Hi !
I have created a matlab script ("main.m") which with a loop. In each iteration I call a matlab GUI slider to get an input from the user.
Using this input and some calculation a plot is shown. this happens in each iteration and the results depend on all previous inputs.
the script looks like this in general
clear all;
close all;
clc;
% Variables Initialization
% Global variables Initialization
for i=1:10000
gui_slider; % call GUI to get input.
uiwait(gui_slider); % wait for input
for j=1:1000
% Do some calculation
end
% Do some calculation
plot(results);
end
% save all results and inputs to excel file
Now instead of showing the plot in a diffrent window, I though about adding axes to the GUI.
What I want to do is to change the order of operation to:
  1. the user to only run the "GUI.m" file.
  2. GUI runs "main.m"
  3. "main.m" takes the slider input
  4. "main.m" does all calcluation the same way.
  5. finally the plot is shown in GUI axes
I couldn't do what I want and I am not sure it by simply running "main.m" in GUI OpeningFcn.
What Other way can accomplish this if possible.
Thanks !

回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by