programming philosophy for GUIs

5 Ansichten (letzte 30 Tage)
Baptiste Caziot
Baptiste Caziot am 11 Dez. 2018
Kommentiert: Walter Roberson am 11 Dez. 2018
Hi.
This is a fairly broad question, but I would like to know how people handle GUIs in matlab, and how it interfaces with a more "traditional" programming style. More specifically, I am using matlab to display visual stimuli and I have accumulated experience in how to write my code to have good timing and be reliable, bug-free. Now, I need to design a GUI so that people with no knowledge of matlab can use my scripts, change parameter values etc. I have managed to do roughly the same same using timer events and a GUI as I would usually do with a traditional sequential script. But I know timings are not reliable this way, plus the code is very messy and prone to bugs.
So how do people usually solve these kind of issues? Can I run a script in parallel of the GUI? Should I use the GUI to set up parameters, close it to run whatever important peice of code I want to run, and reopen it again when timing becomes less critical? I'm not clear on what's the best way to proceed. Any advice or general guidance would be appreciated.
Thanks.
  4 Kommentare
Baptiste Caziot
Baptiste Caziot am 11 Dez. 2018
Yes, I usually use the psychtoolbox to get accurate timing. But here ideally I would like to have a GUI that plots data and allows to change parameters online. I don't know if I can run a PTB script on one hand that controls displays and have accurate timing, and on the other hand have a GUI window that can control the PTB script.
Walter Roberson
Walter Roberson am 11 Dez. 2018
My understanding is that you can do that if you use different displays.
I have not looked at PTB enough to know whether it is possible to temporarily turn off it handling the screen while you run a GUI, then hide the GUI and give control of the screen to PTB.
I suspect it is not possible to have part of a screen controled by PTB and a different part not controlled.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by