I created a function that analyzes data and stores analysis in a structure. To save space, I convert some of the data to logical, however when I save the structure to a file, this field is converted back to a double. I even ask if the variable is logical directly after placing data in field as a variable and it is a double. If I save it outside of the function, this works fine. What am I doing wrong?
peak_data.raster(:,:,1) = logical(data_dark); peak_data.raster(:,:,2) = logical(data_light); if ~islogical(peak_data.raster) error('Data format is incorrect') end
Best Answer