# \#matlab

**URL:** https://psychtoolbox.discourse.group/tag/matlab/21.md

[Latest](https://psychtoolbox.discourse.group/latest.md) · [Categories](https://psychtoolbox.discourse.group/categories.md) · [Tags](https://psychtoolbox.discourse.group/tags.md)

---

## [Gabor generation](https://psychtoolbox.discourse.group/t/gabor-generation/5724)

<div class="topic-metadata">

**Author:** [@blob](https://psychtoolbox.discourse.group/u/blob)\
**Replies:** 1\
**Last updated:** [June 18, 2025, 2:22pm UTC](https://psychtoolbox.discourse.group/t/gabor-generation/5724 "2025-06-18T14:22:47Z")

</div>

what did he mean when he says in the commentars that it could be written in a nicer way? what is wrong with this actual verison? if 1 % Definition of a Gabor patch as Matlab grayscale matrix 'm' with % proper si…

---

## [PTB adding folders to Matlab path on startup](https://psychtoolbox.discourse.group/t/ptb-adding-folders-to-matlab-path-on-startup/5240)

<div class="topic-metadata">

**Author:** [@Erroric](https://psychtoolbox.discourse.group/u/Erroric)\
**Replies:** 3\
**Last updated:** [January 26, 2024, 12:06pm UTC](https://psychtoolbox.discourse.group/t/ptb-adding-folders-to-matlab-path-on-startup/5240 "2024-01-26T12:06:23Z")

</div>

The pre-cursors, firstly: Ubuntu Linux 20.04 Matlab R2021b 64-bit PTB 3 v3.0.19 sourced from NeuroDebian (with Mario’s patches to CalibrateMonSpd.m as previously discussed). Paid support info: Order Numbers: TJ3HSUN…

---

## [Listening to keyboard (fmri scanner triggers) while playing videos](https://psychtoolbox.discourse.group/t/listening-to-keyboard-fmri-scanner-triggers-while-playing-videos/4940)

<div class="topic-metadata">

**Author:** [@nass](https://psychtoolbox.discourse.group/u/nass)\
**Replies:** 5\
**Last updated:** [April 18, 2023, 6:28am UTC](https://psychtoolbox.discourse.group/t/listening-to-keyboard-fmri-scanner-triggers-while-playing-videos/4940 "2023-04-18T06:28:48Z")

</div>

I’m using PTB with windows. I’m presenting videos and fixation crosses and it works. I also need to collect fmri triggers (aka keyboard presses) during the entire experiment. I found a solution that suggests using a m…

---

## [Sending trigger and event markers via USB port](https://psychtoolbox.discourse.group/t/sending-trigger-and-event-markers-via-usb-port/4653)

<div class="topic-metadata">

**Author:** [@sepideh](https://psychtoolbox.discourse.group/u/sepideh)\
**Replies:** 1\
**Last updated:** [October 17, 2022, 5:05am UTC](https://psychtoolbox.discourse.group/t/sending-trigger-and-event-markers-via-usb-port/4653 "2022-10-17T05:05:56Z")

</div>

How can I send trigger and event marker signals using PTB from the stimulus presenting laptop (Windows) through the USB port to an external device (Brainvision Actichamp amplifier). I have a USB to serial DB9 cable to c…

---

## [How to return to a previous point in the code based on result of 'if' command](https://psychtoolbox.discourse.group/t/how-to-return-to-a-previous-point-in-the-code-based-on-result-of-if-command/4193)

<div class="topic-metadata">

**Author:** [@Cai](https://psychtoolbox.discourse.group/u/Cai)\
**Replies:** 5\
**Last updated:** [January 22, 2022, 4:52pm UTC](https://psychtoolbox.discourse.group/t/how-to-return-to-a-previous-point-in-the-code-based-on-result-of-if-command/4193 "2022-01-22T16:52:43Z")

</div>

Hi, I have an experiment wherein subjects must press either the left, right or up arrow button. If they choose another keyboard button, an error message should come up reminding them of the restricted choice and they cho…

---

## [How to break out of an infinite 'while' loop](https://psychtoolbox.discourse.group/t/how-to-break-out-of-an-infinite-while-loop/4198)

<div class="topic-metadata">

**Author:** [@Cai](https://psychtoolbox.discourse.group/u/Cai)\
**Replies:** 0\
**Last updated:** [January 22, 2022, 10:19am UTC](https://psychtoolbox.discourse.group/t/how-to-break-out-of-an-infinite-while-loop/4198 "2022-01-22T10:19:25Z")

</div>

Hi, I have an experiment wherein subjects must press either the left, right or up arrow button. If they choose another keyboard button, an error message should come up reminding them of the restricted choice and they cho…
