-1

Let's say: Cell A with size of 1x10 cell:

A={1x10} cell

And the size each matrix in the cell A is like this:

{A}={ [A1] [A2] [A3] [A4] [A5] [A6] [A7] ............ [A10] }
{A}={ [5000x3  double] [3000x3  double] ......... [2222x3 double] }

How can extract each matrix (A1,A2,A3....,A10) from a cell A?

THANKS,

Thanh Ha
  • 139
  • 1
  • 6
  • 1
    `A{i}` extracts the i-th matrix. – OmG Sep 05 '17 at 13:39
  • Thank. If I want to plot in 3d all matrix Ai (1 matrix with 1 color) in only 1 Figure, How can I plot? Example: A1 contain 5000 pts with (x y z) coordinate. A2 contain 3000 pts with (x y z) coordinate....,so on – Thanh Ha Sep 06 '17 at 01:17

1 Answers1

0

As described in detail in matlab documentation here, you can use curly braces to extract items from a cell array, if you wish for the result to be a simple array and not a cell.

Thus A{2} would give you matrix A2.

etmuse
  • 505
  • 2
  • 9
  • Thank. If I want to plot in 3d all matrix Ai (1 matrix with 1 color) in only 1 Figure , How can I plot? Example: A1 contain 5000 pts with (x y z) coordinate. A2 contain 3000 pts with (x y z) coordinate....,so on – Thanh Ha Sep 06 '17 at 01:18
  • Comments are not the place for completely new questions, even if related to the original question. If you really get stuck then ask a new question, but in the meantime I'd recommend investigating the 'graphics' section of the inbuilt documentation – etmuse Sep 06 '17 at 07:59