MATLAB: How to return an empty matrix

image processingImage Processing Toolbox

Considering an image of size 100 X 280. A binary mask of size 7X4. when masking the image with this mask, At the end, Im getting an error that Index exceeds matrix dimensions. For that What can I do? Can I return an empty matrix? If it is possible, how?

Best Answer

YourVariable = []; %this is an empty matrix
Related Question