"d = size(X) returns the sizes of each dimension of arrayX in a vector,d, withndims(X) elements."
You can also very easily try that line in order to find out what it does: load an image and trysize and see what it outputs, like this:
>> X = imread('parula_0.png');
>> V = size(X)
V =
420 560 3
This tells us that my image (an array of numbers), is 420 pixels high and 560 pixels across, and contains 3 pages, one for each of R, G and B. It is worth noting that the syntax
[A,B] = size(X);
does NOT return the rows and columns of a 3D (e.g. image) array. Read the size documentation to know why.
Best Answer