function output=ti_data_write(input,file)

%This function wites a MATLAB image matrix 
%to a file that can be directly read to memory by
%Code Composer

input=double(input);
fid = fopen(file,'wt');
fprintf(fid,'%d %d %d %d %d\n',1651,1,0,1,0);

for j=1:1:480
    for i=1:4:640
        fprintf(fid,'0x%02x%02x%02x%02x\n',input(j,i+3),input(j,i+2),input(j,i+1),input(j,i));
    end
end

status = fclose(fid)
output=1;
