LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2006, 10:01 AM   #1
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Rep: Reputation: 15
Matlab comman, count distinct items in a vector


I have been looking around the matlab help and cannot find it. I want a command that counts the number of distinct entries in a vector so that I can make a histogram (using hist(Y,nbins)) that is broken into the same number of bins as there are distinct entries.

Thanks
 
Old 07-18-2006, 11:38 AM   #2
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
ah, I found it, I was just searching for the wrong keyword. The command is unique, and takes an vector or matrix as a parameter, and returns the set for that vector/matrix (removes duplicates). So then to count the number of distinct items just get the length of that vector.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can you distinct between link and file when using readdir TruongAn Programming 2 09-01-2005 06:25 PM
how to use DISTINCT in Query for all items nephish Linux - Networking 18 07-29-2005 03:37 AM
Two distinct issues -- sound & rxvt Poetics Linux - Software 6 05-11-2005 04:31 AM
Terminal cmd for starting Matlab M-file editor without starting matlab fubzot Linux - Software 2 02-15-2005 06:49 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration