Run 3 screens at a time/parallel screen
Afficher commentaires plus anciens
How to run three screens with the same GUI at a same time in 3 different computers with the same code?
I have a code which plays and forms a GUI and now I want that same GUI exact to be run on the three screens at the same time together with the same code used. How to modify my present code so it happens they way I want?
5 commentaires
Walter Roberson
le 14 Juin 2021
Are the others inactive copies of the first, or do they all have mouse. Is this a gui shared between users or is it a gui mirrored to other users? Is it necessary to see where the mouse tracks?
If the others are just watching, then remote viewers such as Microsoft Teams or Zoom, or TeamViewer (a program designed to allow remote assistance... works well.)
Praneeti Mitra
le 14 Juin 2021
Jan
le 14 Juin 2021
The easy way is to mirror the screens: Then all monitors show the same screen. Which operating system are you using?
Praneeti Mitra
le 15 Juin 2021
Jan
le 16 Juin 2021
I still do not understand, what the problem is. What does this mean: "And all of them will have a singleinput which should run exactly same in all three"?
Does displaying the contents of the main screen on 3 monitors solve the problem? Windows, MacOS and Linux can do this, if you connect 3 monitors to the computer. There is not need to run anything in parallel.
Réponses (1)
Walter Roberson
le 15 Juin 2021
Modifié(e) : Walter Roberson
le 15 Juin 2021
0 votes
https://www.bu.edu/comtech/faculty-staff/classroom-av/instructor-station-desktop-mirroring/ has Windows 10 instructions with diagrams
9 commentaires
Praneeti Mitra
le 15 Juin 2021
Praneeti Mitra
le 15 Juin 2021
Walter Roberson
le 15 Juin 2021
"Mirroring" (or "Duplicating" in the Windows 10 menus) is effectively signal splitting -- the same graphics get sent to all of the monitors configured for it (I do not know what happens for the case where the monitors are different resolutions.)
Because it is a matter of copying the graphics signals, it is not meaningful to talk about "controlling" the GUI from the extra monitors.
In order to be able to "control" the GUI separately you would need a situation with extra keyboards or at least mouse. There are a couple of different configurations for something like that:
- you can have all of the input devices connected to a single host, with a single MATLAB session being used and the graphics being duplicated to multiple monitors. For various reasons I sometimes have up to 5 "mice" hooked up to my Mac, and moving any of them moves the one cursor)
- you can have the different input devices connected to different hosts, with some arrangement for sharing input events back to a single "real" version of the GUI that does all the real work and somehow shares the graphical image back to the clients to display as-is. For example screen-sharing such as zoom or Microsoft Teams
- you can have the different input devices connected to different hosts, each of which is running GUI software and communicating updates to the other copies of the software, with each generating graphics locally. This is how a lot of massive multiplayer games work: the client and server exchange information about what is happening, but each client creates its own graphical view.
Praneeti Mitra
le 18 Juin 2021
Walter Roberson
le 18 Juin 2021
Is it just a coincidence that you have three screens and want to run it three times? Or are you wanting to run the simulation the first time, have the result be put on the first screen, run again and have the second run display on the second screen, run again and have the third run display on the third screen?
If you need to be able to control the first simulation while the other two are still visible, then in some cases that is feasible.
If more than one simulation needs to be actively computing at the same time, then you can run into challenges that might start needing the Parallel Computing Toolbox to run the calculations, while the main process receives data from the workers to present to the display; this is a bit complicated but generally possible.
Praneeti Mitra
le 19 Juin 2021
Walter Roberson
le 19 Juin 2021
I think MATLAB has a property which allows the screen to be dragged to other computers.
No, it does not have such a property.
If the operating system being used permits multiple monitors, then MATLAB can be used to request that figure windows be placed on a specific display. (However, controls such as message boxes and file browsers tend to show up on the "main" display.)
If the operating system being used permits dragging a window to a different display, then MATLAB is fine with that.
However, being able to position graphics on to different displays that are connected to the same computer is not the same as being able to drag graphics onto a different computer.
In MATLAB, a "GUI" is the same thing as a figure window. figure windows can have behaviour attached to them. There is no difference to MATLAB whether you create a figure() and create pushbuttons and edit fields on it ("GUI") or if instead you just display plots in it. Indeed, it turns out that some of the things that look like plain plots in fact have behaviour attached to them -- for example a bodeplot() turns out to be designed for interactive use, not just for display of static information.
MATLAB permits an indefinite number of simultaneous figure windows -- and so it permits an indefinite number of GUIs at the same time. It is no problem to MATLAB to have three different figure windows on three different displays, each with different behaviour attached to them.
However... any of them can destroy any of the others. So if you program three different GUI and each of them has "clear all; close all", then those GUI are not compatible with each other. If each of the three uses the same global variable, then it is the same global variable. If one of the GUI requests a "modal" dialog box, then the other GUI cannot process events until the modal dialog is closed. The different GUI are not fully independent.
When you are running three different GUI in the same MATLAB session, then only one of them can be computing at any one time. In some cases, depending how you write the code, if you click in a different GUI, you might be able to temporarily suspend progress on the first GUI to process the event. It is sort of like only having one battery to share between three different toys.
It is possible to use Parallel Computing Toolbox to have multiple GUI computing at the same time, but the limitation is that only the client program can talk to the displays, so the different workers would have to send information back to the client and the client would have to use the information to make changes to the displays. This is more awkward to program than you might hope.
Praneeti Mitra
le 20 Juin 2021
Modifié(e) : Praneeti Mitra
le 20 Juin 2021
Walter Roberson
le 22 Juin 2021
Do? You? Need? All? Three? To? Be? Actively? Computing? At? The? Same? Time?
This is a different question than being able to control the three independently.
If you do need all three to be actively computing at the same time, then you must use the Parallel Computing Toolbox. Do you have that toolbox?
I am not going to spend the time to write up solutions to cover all of the possibilities: you need to be more specific about what you need.
The simulations: do you give them inputs or commands, and they run a small number of seconds and then finish that step and go back to waiting for inputs? Or do they have a bit of computation to do (say) every 1 minute? Or is it something like you have three guided Deep Learning going on at the same time and so you give instructions to one simulation and it goes away and computes for extended periods, occasionally displaying graphics, and the person monitoring might react to the graphics by interrupting the computation, or by changing a slider and expecting that the simulation will start using the new value as soon as feasible?
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!