Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

please explain the output of this matlab code

Posted on 2009-04-02
1
Medium Priority
?
77 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 1000 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This article will show, step by step, how to integrate R code into a R Sweave document
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

609 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