'Add two images in MATLAB w/o resizing image

Running this code gives me an error that I cannot fix. How can I solve this without resizing the original image and still add that 2 images?

    a = imread('sample1.jpg'); 
    b = imread('sample2.jpg');
    
    c = imadd(a, b);
    imshow(c);

I'm getting the following error enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source