Solved

Please explain the results of the code provided

Posted on 2009-04-02
3
69 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
bigDiff challenge 17 123
pre4 challenge 19 103
My project did see openJDK that I installed. What could be the problem 7 151
Least Squares Curve Fitting 4 96
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

792 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