I have several gray-scale images and I want to store that in a 3d array(hieghtXwidthXnumber-of-images) in matlab.
my code looks like this
train_img = [];
parfor i=1:100
a = imread(image-file);
a1 = imresize(a, 0.5);
b = rgb2gray(a1);
d = im2double(b);
train_label = [train_label;p];
train_img = cat(3,train_img(:,:,:),d);
end
Error: The temporary variable train_img in a parfor is uninitialized. See Parallel for Loops in MATLAB, "Uninitialized Temporaries".
In the above code the parfor i=1:100, I don't know whats the upper limit of loop. Its decided at run time. Could anybody let me know what this error means and how to overcome this?