App Designer Capabilities - it is nerve-wrecking!
16 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I am exploring the app-designer instead of GUI. I want to use the app-designer just because it looks nicer, but I am having difficulty figuring out its capacilities. It is getting really nerve-wrecking actually b/c it is hard to find examples on app designer, even something little takes long time to figure out. I have quick questions I will list below. In an app that is compiled as a standalone:
- Can I add "print" to the menubar, the generic "print" we have on a typical guide?
- Can I add, save, saveas,... to menubar, in this save it d save whatever is seen on the app's current screen including all components?
- Can I manipuate a table to have move-up and move-down buttons?
- Can I have pan, rotate, etc. for a figure?
I think all of those are doable using "Guide", I wonder if they are doable in the app-designer? I appreciate if you guys could answer those questions!
0 件のコメント
採用された回答
Adam Danz
2019 年 8 月 1 日
編集済み: Adam Danz
2019 年 8 月 2 日
1) "Can I add print to the menubar?
You can add anything you want to the menubar. From the AppDesigner interface, drag and drop the Menu Bar from the Figure Tool section to your GUI. Add a new menu item and rename the new "Menu" to "Print". Then in the MenuSelectionFcn() callback function, you can assign any subroutine you'd like. However, print() is not supported for UIFigures (bummer) so I'm not sure what you intend to print. You can always use a 3rd party screen shot program.
2) "Can I add, save, saveas...."
Similar to my comment above, save(), saveas() and savefig() are not supported for UIFigure (double bummer).
[UPDATE]
If you're working with GUIDE or a GUI developed from uicontrol(), you can add a button, name it "save", and in its callback function, you can save an image of the GUI like this.
saveas(handles.MyGUI, 'MyGUIsnapshot', 'png')
% * 'MyGui' is the handle to your GUI figure.
% * I don't recommend saving it as 'fig' since you'll end up with
% multiple GUIs instead of an image of your GUI.
3) "Can I manipuate a table to have move-up and move-down buttons? "
The tables in appdesigner already have those features.
4) "Can I have pan, rotate, etc. for a figure?"
pan(app.UIAxes, 'on')
rotate3d(app.UIAxes, 'on')
11 件のコメント
Adam Danz
2019 年 8 月 4 日
"Do you know if there is a way to use the latex format within a table cell or editable text field in app-designer?"
I'd have to do some googling. Maybe this?
" is there a way to make table values to be centered in app-designer?"
While we're at it, here's a list of all properties you can change in a UItable
その他の回答 (1 件)
Paul Dirac
2020 年 3 月 3 日
It is absolutely incredible that Mathworks, after all these years, still hasn't found a decent way to create advanced GUIs.
Now, they are forcing everyone to migrate from GUIDE to App Designer, which sucks even more and imposes even more limitations. The App Designer developers seem to do everything to make GUI development with Matlab an even bigger pain in the bottom than it was with GUIDE.
7 件のコメント
Ted H
2022 年 12 月 28 日
編集済み: Ted H
2022 年 12 月 28 日
@Image Analyst I might ditch app designer. My goal was to set up a simple swarm plot (similar to box and whiskers). My table has about 80 variables of measurements and categories. A user would print a swarm graph of a voltage measurement chosen from a drop down in categories across the x axis chosen by another drop down. An example might be choosing Va from the list (Va, Vb, Vc) and choosing the car variable as the category. The result is a swarm/box plot for each car in that variable across the x axis. What I am finding is appDesigner has only built in axis graph (x,y plotting like to plot a sine wave), and I have to create a swarm plot 'template' in the startup function, if I want to graph in the developed app. I have gotten as far as opening a figure window, but no data shows up. I am not even sure how to troubleshoot that (it works in regular matlab). And I have yet to find examples of how to do this. It should be simple. Matlab might need to redefine their competitors and focus development there.
Adam Danz
2022 年 12 月 28 日
@Ted H, if you have this working outside of AppDesigner then it can work inside app designer. You can define local private functions within AppDesigner. Move your plotting function from the m file to a local function within the app. If you're not doing so already, specify the axes handles in your plotting commands. For example:
plot(app.UIAxes, __)
The app's startup function can initialize the plot and the plot can be updated any time any parameter value is changed by the users by setting up callback functions for the app components.
Alternatively, your app can generate the plot outside of appdesigner if that's what you're aiming for.
参考
カテゴリ
Help Center および File Exchange で Printing and Saving についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!