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:
help please

Subject: help please

From: ravi

Date: 19 Feb, 2010 15:52:04

Message: 1 of 4

I have an array X

X = [sd' ; vd']'

My output is as follows
X =

         658 1072
          96 103
         760 1089
         292 298
         777 1034
         353 357

I wish INSTEAD to output like this:

X = 658 96 1072 103
      760 292 1089 298
      777 353 1034 357

What Can I Do To Achieve This???

Best,
ravi

Subject: help please

From: Jos (10584)

Date: 19 Feb, 2010 16:08:05

Message: 2 of 4

"ravi " <ravi_071@hotmail.com> wrote in message <hlmc34$25j$1@fred.mathworks.com>...
> I have an array X
>
> X = [sd' ; vd']'
>
> My output is as follows
> X =
>
> 658 1072
> 96 103
> 760 1089
> 292 298
> 777 1034
> 353 357
>
> I wish INSTEAD to output like this:
>
> X = 658 96 1072 103
> 760 292 1089 298
> 777 353 1034 357
>
> What Can I Do To Achieve This???
>
> Best,
> ravi

You need to tell us how sd and vd look like!

You might try fiddling around with reshape, transpose and horz/vertcat yourself ...

Jos

Jos

Subject: help please

From: ravi

Date: 19 Feb, 2010 16:13:05

Message: 3 of 4

Jos,

sd and vd looks like:

>> sd

sd =

   658
    96
   760
   292
   777
   353


>> vd

vd =

        1072
         103
        1089
         298
        1034
         357

thanks ravi

Subject: help please

From: Jos (10584)

Date: 19 Feb, 2010 16:24:05

Message: 4 of 4

"ravi " <ravi_071@hotmail.com> wrote in message <hlmdah$lo8$1@fred.mathworks.com>...
> Jos,
>
> sd and vd looks like:
>
> >> sd
>
> sd =
>
> 658
> 96
> 760
> 292
> 777
> 353
>
>
> >> vd
>
> vd =
>
> 1072
> 103
> 1089
> 298
> 1034
> 357
>
> thanks ravi

It is a simple but yet very educative problem.
Hint: use reshape and transpose on these two vectors before you concatenate them.

Jos

Tags for this Thread

No tags are associated with 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