Skip to content

Commit e819ff4

Browse files
authored
Improve the readability of X waveform code
1 parent 3ee4728 commit e819ff4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

code/DAQmx_Scanners/waveformTester.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,13 @@ function generateScanWaveform(obj)
241241
switch obj.waveformType
242242

243243
case 'sawtooth'
244-
% The X waveform goes from +galvoAmp to -galvoAmp over the course of one line.
244+
% The X waveform goes from +galvoAmp to -galvoAmp over the course of one line:
245245
xWaveform = linspace(-obj.galvoAmp, obj.galvoAmp, obj.pixelsPerLine);
246-
obj.waveform = repmat(xWaveform, 1, obj.numReps)'; % Repeat the X waveform a few times to ease visualisation on-screen
246+
247+
% Repeat the X waveform a few times to ease visualisation on-screen
248+
xWaveform = repmat(xWaveform, 1, obj.numReps)'; % NOTE! It's a column vector
249+
250+
obj.waveform = xWaveform; % Assign to the waveform property which gets written to the DAQ
247251

248252
case 'sine'
249253
% sine wave

0 commit comments

Comments
 (0)