MATLAB: Fusion of satellite images

digital image processingimageimage analysisimage processingMATLABMATLAB and Simulink Student Suitematlab function

Hello
I want to make a fusion between 3 image (satellite type image attached) I tried with this code but it did not work someone has an idea and thank you in advance.
image(:,:,1)= load('C1fig.mat');
image(:,:,2)= load('C2fig.mat');
image(:,:,3)= load('C3fig.mat');

Best Answer

First, don't use image as a variable name, it's already the name of a matlab function that you may want to use. In the same vein, don't name your variables ans (as they are named in the mat files). This is a special variable in matlab. If these ans variable come from a function, then call that function with an output variable with a sensible name instead of calling that function with no output.
load with an output variable (which is the correct way to use load) creates a structure where each field is one of the variable in the mat file. So your first load will create field ans in image(:,:,1) variable. Because load always return a scalar structure, the : are equivalent to 1. With your code, you are in effect creating a 1x1x3 structure with field ans. A simpler and clearer way to achieve this is with:
imgs = []; %make sure it's empty before we load the mat file. Not calling it image but imgs
imgs(1) = load('C1fig.mat');
imgs(2) = load('C2fig.mat');
imgs(3) = load('C3fig.mat');
Now, it's not clear what you call fusion. Going by your original code, it looks like you want to merge all three greyscale images as a true colour image, with the first one being the red channel, the second the blue channel and the third the red channel. If that's the case, then:
img = cat(3, imgs.ans);
imshow(img)
If by fusion you mean something else entirely, then you need to clarify.