Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
generating matrix in O-D format

Subject: generating matrix in O-D format

From: dibyendu

Date: 28 Nov, 2012 08:20:35

Message: 1 of 5

i have a matrix
A=[1 2 3
3 2 5
5 3 6
5 4 4
7 5 3
6 6 2]
now if for each interval of 2 in column 2 and column 3 i want to average column 1. in atlab

Subject: generating matrix in O-D format

From: Nasser M. Abbasi

Date: 28 Nov, 2012 08:50:13

Message: 2 of 5

On 11/28/2012 2:20 AM, dibyendu wrote:
> i have a matrix
> A=[1 2 3
> 3 2 5
> 5 3 6
> 5 4 4
> 7 5 3
> 6 6 2]
> now if for each interval of 2 in column 2 and column 3 i want to average column 1. in atlab
>


Can you write down what is output should be for the above input?

--Nasser

Subject: generating matrix in O-D format

From: dibyendu

Date: 28 Nov, 2012 15:55:21

Message: 3 of 5

out put will be like that
     1 3 5 7
1 0 1 3 0
3 0 4 3 0
5 6 5 0 0
7 0 0 0 0

like that there may be a 100 by 100 matrix for more numbers.
1st interval is 0 to 2, so denoted by 1, 2nd interval is 2 to 4 so denoted by 3 and like that..
"3Nasser M. Abbasi" <nma@12000.org> wrote in message <k94j87$nte$1@speranza.aioe.org>...
> On 11/28/2012 2:20 AM, dibyendu wrote:
> > i have a matrix
> > A=[1 2 3
> > 3 2 5
> > 5 3 6
> > 5 4 4
> > 7 5 3
> > 6 6 2]
> > now if for each interval of 2 in column 2 and column 3 i want to average column 1. in atlab
> >
>
>
> Can you write down what is output should be for the above input?
>
> --Nasser

Subject: generating matrix in O-D format

From: Nasser M. Abbasi

Date: 28 Nov, 2012 17:12:08

Message: 4 of 5

On 11/28/2012 9:55 AM, dibyendu wrote:
> out put will be like that
> 1 3 5 7
> 1 0 1 3 0
> 3 0 4 3 0
> 5 6 5 0 0
> 7 0 0 0 0
>

> 1st interval is 0 to 2, so denoted by 1, 2nd interval is 2 to 4 so denoted by 3 and like that..

>>> A=[1 2 3
>>> 3 2 5
>>> 5 3 6
>>> 5 4 4
>>> 7 5 3
>>> 6 6 2]
>>> now if for each interval of 2 in column 2 and column 3 i want to average column 1. in atlab
>>>

Sorry, I do not understand at all. Hopefully someone else will and
help you.

good luck

--Nasser

Subject: generating matrix in O-D format

From: Steven_Lord

Date: 28 Nov, 2012 18:05:31

Message: 5 of 5



"dibyendu " <paldhere@gmail.com> wrote in message
news:k95c59$fok$1@newscl01ah.mathworks.com...
> out put will be like that
> 1 3 5 7
> 1 0 1 3 0
> 3 0 4 3 0
> 5 6 5 0 0
> 7 0 0 0 0
>
> like that there may be a 100 by 100 matrix for more numbers.
> 1st interval is 0 to 2, so denoted by 1, 2nd interval is 2 to 4 so denoted
> by 3 and like that..

It's still not clear. Please walk the group in more detail through the EXACT
process you followed to get from:

>> > A=[1 2 3
>> > 3 2 5
>> > 5 3 6
>> > 5 4 4
>> > 7 5 3
>> > 6 6 2]

to the table above.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

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.

Contact us