Thread Subject: array question

Subject: array question

From: Sean Douglas

Date: 24 Jul, 2009 13:31:01

Message: 1 of 3



hey guys... I am trying to make an array by just copy and pasting an example right out of The Math Workds website. The website shows the results I should be getting to be a little different then what I get. I want to understand why.
For example, to create a 2-by-2 cell array A, type

For example, to create a 2-by-2 cell array A, type
A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi};
This results in the array shown below.



there example shows that for cell 1,1 I should actually get Matirx A with the integers, but when I put it in the Matlab I get:
>> A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi}

A =

          [3x3 double] 'Anne Smith'
    [3.0000 + 7.0000i] [1x9 double]


please let me know why my cells 1,1 and 2,2 are just a discription of what I want. Is the information there for future use and I just cant see it. Is there something i can do so I can see it.

thanks

Subject: array question

From: Andy Eisenberg

Date: 24 Jul, 2009 13:40:19

Message: 2 of 3

"Sean Douglas" <seanjdouglas@hotmail.com> wrote in message <h4cd2l$bnr$1@fred.mathworks.com>...
>
>
> hey guys... I am trying to make an array by just copy and pasting an example right out of The Math Workds website. The website shows the results I should be getting to be a little different then what I get. I want to understand why.
> For example, to create a 2-by-2 cell array A, type
>
> For example, to create a 2-by-2 cell array A, type
> A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi};
> This results in the array shown below.
>
>
>
> there example shows that for cell 1,1 I should actually get Matirx A with the integers, but when I put it in the Matlab I get:
> >> A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi}
>
> A =
>
> [3x3 double] 'Anne Smith'
> [3.0000 + 7.0000i] [1x9 double]
>
>
> please let me know why my cells 1,1 and 2,2 are just a discription of what I want. Is the information there for future use and I just cant see it. Is there something i can do so I can see it.
>
> thanks

The information is there. It just is too big to fit in the one line given to that cell in the print out (since it's a 3x3 matrix). If you type A{1,1}, you will get the data in cell 1,1.

Subject: array question

From: Nicky

Date: 24 Jul, 2009 14:41:02

Message: 3 of 3

"Sean Douglas" <seanjdouglas@hotmail.com> wrote in message <h4cd2l$bnr$1@fred.mathworks.com>...
>
>
> hey guys... I am trying to make an array by just copy and pasting an example right out of The Math Workds website. The website shows the results I should be getting to be a little different then what I get. I want to understand why.
> For example, to create a 2-by-2 cell array A, type
>
> For example, to create a 2-by-2 cell array A, type
> A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi};
> This results in the array shown below.
>
>
>
> there example shows that for cell 1,1 I should actually get Matirx A with the integers, but when I put it in the Matlab I get:
> >> A = {[1 4 3; 0 5 8; 7 2 9], 'Anne Smith'; 3+7i, -pi:pi/4:pi}
>
> A =
>
> [3x3 double] 'Anne Smith'
> [3.0000 + 7.0000i] [1x9 double]
>
>
> please let me know why my cells 1,1 and 2,2 are just a discription of what I want. Is the information there for future use and I just cant see it. Is there something i can do so I can see it.
>
> thanks

The information you entered is actually there, it just doesn't display all the data because it only provides 1 line to describe each cell. If you type A{1,1} you will see the actual data, or you can double click on A in the Workspace (where it lists all the current variables) then click on the (1,1) spot and it will show the actual array that is stored there

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
array question Sean Douglas 24 Jul, 2009 09:34:05
rssFeed for this Thread

Contact us at files@mathworks.com