Solved

please explain the output of this matlab code

Posted on 2009-04-02
1
71 Views
Last Modified: 2016-02-10
When I run the code below for the attached image, I was expecting a single value for a max but got a load of values I dont understand?

Can someone please explain this for me
I=imread('C:\Users\Justin\Documents\MATLAB\lab2\lightbulb', 'jpg');
    d=max(I)

Open in new window

lightbulb.jpg
0
Comment
Question by:jtiernan2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
yuk99 earned 250 total points
ID: 24053680
No, the function calculate maximum value for each vector in the 1st dimension, means across rows. So if array I is MxNx3 you should get 1xNx3 result after MAX function. To find maximum value for the whole array do max(I(:)).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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
sumNumber challenge 16 140
centeredAverage challenge 8 185
copyEvens challenge 6 116
groupSum5 challenge 5 102
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…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

749 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