Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 95
  • Last Modified:

Please explain the results of the code provided

when I run the code below for the attached image, I get

450   348     3

It is not very clear in the Matlab help files.
Which is colum length and which is row length?
How come there are three responses here? Shouldnt there just be length by width?
What is 3?
I=imread('lightbulb', 'jpg');
d=size(I)

Open in new window

lightbulb.jpg
0
jtiernan2008
Asked:
jtiernan2008
  • 3
1 Solution
 
yuk99Commented:
With the first line you read the image file into 3-dimentional array mxnx3. m is your image height in pixels, n - width and 3 means 3 layers of RGB colors for each pixel - red, green and blue.
So the second line will give the dimensions (size) of your array in the form [m n 3].
0
 
yuk99Commented:
Be the way, you can see documentation of any function in Matlab with the command:
doc function_name
0
 
yuk99Commented:
First number after size function is always number of rows (it's 1st dimension), second - number of columns, third - pages (or layers), and so on.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now