simple syntax problem need help "curly braces"

2 visualizaciones (últimos 30 días)
Robert
Robert el 1 de Mayo de 2016
Comentada: Image Analyst el 2 de Mayo de 2016
Im completely confused what matlab is doing here
Can someone tell me
I tried using help file but don't get what its talking about
A(2,1) = {[1 2 3; 4 5 6]}
What is this thing doing?
If i ask it what A is i get
ans =
[2x3 double]
How do i index A properly to get back to my data?
Is this making a structure of some sort? If i ask it was A(1,1) is it tells me the same answer
So what are the curly braces doing here? Thanks in advance

Respuestas (1)

Walter Roberson
Walter Roberson el 1 de Mayo de 2016
A{1} would get you back the 2 x 3 matrix.
  7 comentarios
Stephen23
Stephen23 el 2 de Mayo de 2016
Editada: Stephen23 el 2 de Mayo de 2016
"but far more complicated"
I think slightly more complicated would be a better adjective.
Cell arrays are not confusing. They are just boxes, into which things can be placed (and later removed). What is so complicated about that?
Image Analyst
Image Analyst el 2 de Mayo de 2016
Trust me - they're one of the most confusing variables in MATLAB. We see it here everyday with users not knowing how to use them. You know that's true. Maybe not complicated for us, but for new users they're complicated - the daily evidence speaks for itself.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by