MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

If you have arrays RED, GREEN, and BLUE in your workspace, then these commands create
a scalar structure named img that uses plane organization:


img.red = RED;
img.green = GREEN;
img.blue = BLUE;


Plane organization allows you to easily extract entire image planes for display, filtering, or
other processing. For example, multiply the red intensity values by 0.9:


adjustedRed = .9 * img.red;


If you have multiple images, you can add them to the img structure, so that each element
img(1),...,img(n) contains an entire image. For an example that adds elements to a
structure, see the following section.


Ways to Organize Data in Structure Arrays
Free download pdf