필터 지우기
필터 지우기

Passing data fra one Appdesigner GUI to another

조회 수: 1 (최근 30일)
Mikkel Eskildsen
Mikkel Eskildsen 2018년 11월 14일
댓글: Mikkel Eskildsen 2018년 11월 14일
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