Passing data fra one Appdesigner GUI to another

1 次查看(过去 30 天)
I tried reading some of the documentation about this, but I couldn't get it to work. I have attached pictures of two GUI's made in Appdesigner.
The one called rfdgui.mlapp lets you browse for a .csv-file, and shows you which file you have chosen in the text field below. When you click "Analysér" (Analyze),
the chosen .csv-file is read and a number of variables are calculated on the data within it - this works. However, I want to pass some of these variables to the other GUI (results.mlapp), so they are shown in their corresponding component. I've played a little with creating some global properties, but nothing succesful.
  2 个评论
Adam
Adam 2018-11-14
https://uk.mathworks.com/help/matlab/creating_guis/app-designer-startup-function.html should help with this. Just pass the arguments you want into the 2nd GUI via the startup function if you are creating the 2nd GUI at the point when you want to pass them in.
If you just want to pass them to a pre-existing 2nd GUI then you just need to have stored your class objsect for that 2nd GUI and add whatever public properties or functions you want to it that you can call/set from the 1st GUI.
Mikkel Eskildsen
Mikkel Eskildsen 2018-11-14
So in the following:
% Code that executes after component creation
function startupFcn(app, PeakForceNewtonRight)
app.PFN_Right.Value = PeakForceNewtonRight;
end
The component PFN_Right is an Edit Field where i want the variable "PeakForceNewtonRight"
from rfdgui.mlapp to show it's value. But when I run it, I get "Not enough input arguments"?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by