figure versus uifigure the best way to manage complex gui

7 views (last 30 days)
I am currently writing complex gui for scientific computation app which must be compatible both with figure and uifigure. My experience is that using uifigue the gui is always very time consuming to build and drag and drop is not reactive. Moreovers save gui as a *.fig may take 15 ~ 20 mn and when openfig is executed to come back at the state where user exit the app, does not work except for basic interface tests.
Using figure all is right. My question is the following what is the goal of mathworks in the future. I use matlab since 1984 it was an extraordinary tool. Nice gui is today a necessary step when developping large engineering app. It is always a difficult task, java customization helps very much. Waterloo toolbox is a good exemple. Why to abandon this approach? The beautiful functions inluded within gui layout toolbox should be directly included within matlab. Web oriented figure is a specifig goal, if figure could support the new uifigure facilities it would be perfect!
Is there some subtilities to know to have better experience with uifigure.
Using matlab is very easy, learning java was not trivial and now with uifigure it would be necessary to learn javascript....?
Best regards
  1 Comment
Bruno Luong
Bruno Luong on 6 Jul 2022
Let me guess : you would never get an answer from TMW folks on their roadmap.
To me the only reason I would use uifigure is if you are interested in embeded the components that are not supported in stadard figure. They look more modern. Personaly I use the uitable with great features.
Otherwise I would stick with figure.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 6 Jul 2022
I do not know why uifigure is so much slower than traditional figures. I know people have been grumbling about that for years, and I know the current situation is better than it used to be.
With regards to "Why?":
One of the reasons is that Mathworks is trying to remove dependency on Java. There are a couple of reasons for this:
  • industry has been finding Java too slow and not flexible enough for modern use
  • Oracle put in a per-desktop end-user license charge to use Java. As a result, a lot of companies are getting out of Java as soon as they can, so that end users do not have to pay Oracle to use products such as MATLAB. Mathworks uses the last no-charge version of Java Development Kit
  1 Comment
Yair Altman
Yair Altman on 6 Jul 2022
In addition to the wish to avoid Java, basing the UI on web technologies (HTML, CSS, JavaScript) will enable users to use MathWorks products on any platform that supports a Chrome browser, and this has significant potential benefits. For example, in the future we could use Matlab on smartphones, tablets, and other platforms that do not currently support Matlab (we can use Matlab Online already, with some limitations - over time I expect these limitations will decrease). MathWorks is still not quite there with the conversion (it's an enormous development effort), but the path forward is quite clear. And indeed, performance is indeed a problem (getting better with each new release, though).

Sign in to comment.

More Answers (1)

Alain Barraud
Alain Barraud on 6 Jul 2022
yes me too about uitable, althought using java similar result can be obtained. Uitree is also very useful with uifigure. I have not be able to have similar aesthetic results with figure (widget toolbox). Why not uifigure I hope better speed in the future.
  4 Comments
Alain Barraud
Alain Barraud on 6 Jul 2022
Yes you are right. Adding to your code
mtree.Tree.setBackground(java.awt.Color(0,.8,1))
do the job. The nodes remain white OK. (I don't remember how to access to the Nodes properties)

Sign in to comment.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!