I figured it out!
%so I want to cycle through all RGB values possible. This will take a
%series of for loops, one for each color value. Brightness is still
%unknown. Also need to convert 0-255 to 0-1.
RGBCycler = VideoWriter('\Users\~\Documents\MATLAB\RGB_by15units_5secs_withWhite.mp4','MPEG-4');
RGBCycler.FrameRate = .5; % Frames per second (speed of video)
open(RGBCycler);
% current figure handle
x = 0
y = 0
z = 0
k = 0
j = 0
i = 0
h = [0 1 1 0];
l = [0 0 1 1];
patch(h,l,[0 0 0])
set(gca,'visible','off')
tic
for k = 1:17
z = 0; y = 0
x = x + 15;
for j = 1:17
z = 0;
y = y + 15;
for i = 1:17
z = z + 15;
col = [ x/255 , y/255, z/255 ]
patch(h,l,col)
pause(.5);
f = getframe;
writeVideo(RGBCycler,f);
clf
%To seperate between slight differences in color and reset the spectrometer.
patch(h,l, [1, 1, 1])
pause(.5);
f = getframe;
writeVideo(RGBCycler,f);
clf
end
end
end
toc
close(RGBCycler);