Help most definitely needed :) Indexing struct arrays for rows with specified values
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
mashtine
el 21 de Feb. de 2014
Comentada: mashtine
el 24 de Feb. de 2014
Hi everyone,
I have a struct array that has 35 cell arrays within it, each having 7 matrices (1.3 million x 1). I am trying to index the rows with a value of 4 within the second matrix ( MyData(1,n).data{1,2} ) and do this for all 35 cell arrays and place it into a new cell array. No success is coming my way.
So far for the indexing I have this but I keep getting the error of ??? Index exceeds matrix dimensions:
stid = 4;
colmn = 2;
p1 = MyDataToo(1,1).data{MyDataToo(1,1).data{:,colmn} == stid, :};
I want to figure this out before I even move on to making it a loop to then do this for the other 34 cell arrays in the struct.
Help most certainly needed!!
0 comentarios
Respuesta aceptada
Walter Roberson
el 21 de Feb. de 2014
Try
p1 = MyDataToo(1,1).data([MyDataToo(1,1).data{:,colmn}] == stid, :);
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!