Solved

Please explain the results of the code provided

Posted on 2009-04-02
3
70 Views
Last Modified: 2016-02-10
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
Comment
Question by:jtiernan2008
  • 3
3 Comments
 
LVL 15

Accepted Solution

by:
yuk99 earned 250 total points
ID: 24053610
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
 
LVL 15

Expert Comment

by:yuk99
ID: 24053634
Be the way, you can see documentation of any function in Matlab with the command:
doc function_name
0
 
LVL 15

Expert Comment

by:yuk99
ID: 24053656
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FizzBuzz challenge 9 83
groupNoAdj 7 115
Problem to event 3 112
Support for Notepad++ (including downloading & installing a plugin) 5 191
Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question