How might I build a full UI for a piece of Matlab numerical code? [closed]
-
08-02-2021 - |
Question
I am researching building a full UI for a piece of Matlab numerical code. I can of course port the code to another platform and build the UI in the usual suspects (Qt, Java, etc), but it would be much preferable to communicate with the scientists on the project to retain the code in Matlab.
What is the recommended approach here? I found some old (ca 2007) tutorial on building UI for Matlab, but nothing really good. There is also "MATLAB Advanced GUI Development" (Scott T. Smith), which is very on-topic but dates back all the way to 2006.
So what's the modern approach to building a UI for Matlab? What are the recommended references?
The UI aims to provide data visualization as 2D plots, not in strict realtime but under a second, and some minor interactive capabilities (e.g selecting options or click-selecting coordinates).
Solution
The topic is very broad, it depends also on your time constrains and general knowledge of GUI frameworks like Java Swing. I think there is no one best answer but these links could still help:
Software engineering and patterns in Matlab GUI application?
How can I program a GUI in MATLAB?
how to implement the idea of mvc design in matlab gui's
Software engineering and patterns in Matlab GUI application?
Is the MATLAB gui creator GUIDE as awful as I think? Is there an alternative?
OTHER TIPS
GUIDE is very limited and a pain when used in 'larger' projects. Therefore I suggest to use MATLAB's seamless integration of Java. Undocumented Matlab is an excellent source for Java/MATLAB integration.
Making use of the 'undocumented' areas of MATLAB, a 'dockable' window can be integrated into MATLAB's IDE. Just execute the following code as m-file.
import javax.swing.*;
dt=com.mathworks.mlservices.MatlabDesktopServices.getDesktop;
panel = JPanel();
dt.addClient(panel, 'MyPanel');