- It seems like F isn't being recognized as a structure when you use F(2) in the numel statement. Is it defined in the scope of this for loop?
- To add a property to your app, open it in App Designer, go to Code View (a switch in the upper right hand corner of the center window). Select the Property drop-down in the top banner (in the Insert section), and select public or private property.
Accessing information within a structure in app designer and How to pass data from one push-button to the other
15 次查看(过去 30 天)
显示 更早的评论
Hi, I am developing a simple app using the app designer. This is pretty new to me and I am not experienced when it comes to app designer or gui in general. I have the code below,
for i = numel(F(2))
U_R = [F.y]';
end
- Now F is a structure. It has 3 columns. Column 2 is labeled y and I want to assign y to U_R using U_R = [F.y]. When I run the gui I get an error '' Undefined fuction F for input arguments of type double'. How do I fix this problem?
- Also how do I add a property section such that I can access or pass data to every pushbutton in the gui (app)?
Thank you!
4 个评论
Rachel Surridge
2020-7-18
2. If F is in your base MATLAB workspace, you can import it into your app using a statement like this in the properties section of the app:
properties (Access = private)
F = evalin('base', 'F');
end
If the for loop you posted originally is inside the app, then I think the code above should resolve your first question too. F is likely not being recognized as a structure because the app doesn't know where to find it. Using the evalin statement will put F in a workspace that the app can access, so it will be able to recognize it as a structure.
回答(1 个)
Cris LaPierre
2020-7-18
In the upper left of app designer, you will have the ability to create properties. Use this to add a property to the app structure. This is what makes it available to all functions inside your app. See this page for speciic details.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!