Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Problem with indexing!

Subject: Problem with indexing!

From: Archana Ananthanarayan

Date: 05 Jun, 2008 09:59:02

Message: 1 of 2


I've a problem with finding the index in a single vector.
i've calculated some parameters for a document for some
values of theta ranging from -15 to +15 in steps of 5. that
means

1col -15
2col -10
3col -5
4col 0
5col 5
6col 10
7col 15

i find the maximum value out of these, but i dunno how to
get back the angle correspondingly using the positive matrix
indices. i.e., if the column number i get is 3rd, how do
calculate the actual -5?

Do reply!

Subject: Re: Problem with indexing!

From: someone

Date: 05 Jun, 2008 15:34:02

Message: 2 of 2

"Archana Ananthanarayan" <archana1985_ms@hotmail.com> wrote
in message <g28dd6$1st$1@fred.mathworks.com>...
>
> I've a problem with finding the index in a single vector.
> i've calculated some parameters for a document for some
> values of theta ranging from -15 to +15 in steps of 5.
that
> means
>
> 1col -15
> 2col -10
> 3col -5
> 4col 0
> 5col 5
> 6col 10
> 7col 15
>
> i find the maximum value out of these, but i dunno how to
> get back the angle correspondingly using the positive
matrix
> indices. i.e., if the column number i get is 3rd, how do
> calculate the actual -5?
>
> Do reply!
>

% I'm not exactly sure what you are trying to do
% or what you mean by "maximum", but
% maybe this will get you started:

theta = (-15:5:15)'
index = find(theta==-5) % or the "maximum" value is:
%index = find(theta==max(theta))
theta(index)

% Does this help?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics