Passing Data located on a Vector (or Matrix) Variable from one GUI to another

2 views (last 30 days)
Hello everyone
I am using the AppDesigner in order to create a program where two interfaces are connect through a botton. It is supposed that once I type the values on their EditField, they are put in the vector (with defined dimensions from the beggining) where I will hold all the typed data from both interfaces. Also, I would like that the user can come back to the first interface to correct a mistake if needed.
However, it seems like the Second GUI is not receiving the information and I get the following Error message
Error using GREET_2020_Interface_2/startupFcn (line 35)
Unrecognized method, property, or field 'SIDICAGasolineEditField' for class 'GREET_2020_Interface_2'.
Error in GREET_2020_Interface_2 (line 166)
runStartupFcn(app, @(app)startupFcn(app, varargin{:}))
Which is located on the following code section
function NextButtonPushed(app, event)
GREET_2020_Interface_2(InputVehicles);<-------------ERROR MESSAGE APPEARS
The Second Interface should receive the InputVehicles as it is indicated below:
properties (Access = private)
PreviousInputs <-----It will hold the upcoming values of Interface 1
methods (Access = private)
function startupFcn(app, InputVehicles)
Please, I need your help. I am open to hear alternatives to solve this. I tried to watch YouTube videos but they seem to use an old AppDesigner version. Thank you

Answers (1)

Shravan Kumar Vankaramoni
Edited: Shravan Kumar Vankaramoni on 7 Oct 2021
I understand that you are having issue in transferring data among apps. So, Here is the example that illustrates that functionality.
In the attached file, you will find "choosedialog" function which creates a new app and asks to choose a color, which is sent to the main app once this dialog closes. Below is the code for main app:
function EnterColorsButtonPushed(app, event)
set(app.UIFigure.Children, 'Enable', 'off');
% call to second app which returns a value
c = choosedialog(app);
catch ME
c = "Red";
%storing the value returned from second app into main app local
app.colorData = c;
set(app.UIFigure.Children, 'Enable', 'on');
For more information, visit the below links:
Hope this helps to resolve your issue.


Find more on Startup and Shutdown in Help Center and File Exchange





Community Treasure Hunt

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

Start Hunting!