Effacer les filtres
Effacer les filtres

Passing data fra one Appdesigner GUI to another

1 vue (au cours des 30 derniers jours)
Mikkel Eskildsen
Mikkel Eskildsen le 14 Nov 2018
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 commentaires
Adam
Adam le 14 Nov 2018
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 le 14 Nov 2018
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"?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by