Guide – run multiple commands simultaneously

4 visualizaciones (últimos 30 días)
Matthew
Matthew el 21 de Mayo de 2012
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?
  2 comentarios
Sean de Wolski
Sean de Wolski el 21 de Mayo de 2012
How about using a bar plot for the two tanks?
Matthew
Matthew el 22 de Mayo de 2012
after seeing the rectangle() command, i believe working in handles graphics would be much easier than creating bar graphs.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Mayo de 2012
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.
  5 comentarios
Walter Roberson
Walter Roberson el 22 de Mayo de 2012
Any one rectangle() object can only have one color. To use multiple colors, either use multiple rectangle objects or use patch()
If you use the structure I outlined of two rectangles in the same place representing one tank, then if you fill the background one with red and you make the green filled one progressively wider, the green will cover over the red, giving you much the look you are thinking of.
Matthew
Matthew el 22 de Mayo de 2012
I figured I'd need to use a lot of tiny rectangles to create the gradiant I'm looking for, then slightly change each rectangle's color.
As for the "custom graphics" I was asking about in the last thread, I am going to use patch() and create my own "tanks". It doesnt look that hard.
I think I have all the questions I need answered for the moment. Thanks Walter and Sean for the help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by