To introduce a delay between sending each value from the vv array, you can use MATLAB's "pause" function. This function will pause the execution of your script for a specified number of seconds. Follwoing is the sample code that can help you in understanding the implementation for the same.
% Voltage values to be sent
vv = [2, 4, 6, 8];
% Loop through each voltage value, send it, and pause for 2 seconds
for i = 1:length(vv)
vmd = sprintf(':CHAN1:VOLT %2.2f;VOLT?', vv(i));
fprintf(s, vmd);
pause(2); % Pause for 2 seconds
end
To read more about "pause" function in MATLAB refer to the given documentation: https://www.mathworks.com/help/matlab/ref/pause.html
Hope this helps!
