MATLAB: Guide – run multiple commands simultaneously

guide

Hello,
I’m still new to GUIDE and have been toying around with it for some time. I’ve looked through http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples and understand a fair amount of what Matt posted and seen the majority of videos from Doug from his GUIDE blog posts ( http://blogs.mathworks.com/videos/category/gui-or-guide/). My end goal for learning GUIDE is to feed simulated data into my GUI and have it respond graphically. For learning purposes, I’m starting off trying to learn simple things and build my way up to the end goal. My current goal is to have a "fuel tank" deplete over time while another "tank" heats up simultaneously. Both these “tanks” are just going to be square axes.
For the fuel tank depleting, I thought I could get two axes of different colors – one representing fuel while the other represents emptiness. The “empty" axis would be growing longer, so it would appear that the “fuel” axis would be depleting.
As for the heating up tank, I can use the fill command to change its color over time, which I can already do.
I would like to be able to show both at the same time. Can someone please point me in the right direction?

Best Answer

An axes is a portion of a screen within which you can put graphics. You would not often want to change the size of your axes as the program runs, but you might change the size of something you have drawn in the axes.
I suggest you consider using a single axes, and two rectangle() commands that represent the outside of the fuel tanks, and two filled rectangle() commands that represent the volume or heat.
It is not possible to run multiple MATLAB graphics command simultaneously. Even if you had the Parallel Computing Toolbox, or were to spawn additional Java processes, all MATLAB graphics is forced to go through one single thread in order to prevent inconsistencies in the graphic structures. Instead, update the graphic objects sequentially. MATLAB only updates the screen under limited circumstances, so even though the instructions might be given sequentially, the combined result of the instructions is most likely what will show up on the screen on the next screen update.