Filter löschen
Filter löschen

Indexing for cell arrays

1 Ansicht (letzte 30 Tage)
Joseph Lee
Joseph Lee am 20 Nov. 2017
Kommentiert: Joseph Lee am 22 Nov. 2017
I have 10x1300 cell array z, how do i find a certain value of z using indexing
find(abs(z-z_position)<intvl) did not work
and how do i do the opposite as well? eg. z{1,1}(1)
A portion of z, z value is random for each cell.
Columns 1296 through 1300
[1×23 double] [1×23 double] [1×29 double] [1×23 double] [1×25 double]
[1×27 double] [1×25 double] [1×25 double] [1×25 double] [1×27 double]
[1×21 double] [1×25 double] [1×27 double] [1×27 double] [1×25 double]
[1×27 double] [1×29 double] [1×29 double] [1×25 double] [1×23 double]
[1×27 double] [1×25 double] [1×23 double] [1×27 double] [1×27 double]
[1×27 double] [1×27 double] [1×23 double] [1×21 double] [1×23 double]
[1×25 double] [1×29 double] [1×27 double] [1×27 double] [1×27 double]
[1×27 double] [1×21 double] [1×21 double] [1×29 double] [1×27 double]
[1×25 double] [1×25 double] [1×25 double] [1×21 double] [1×27 double]
[1×23 double] [1×25 double] [1×25 double] [1×25 double] [1×23 double]

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Nov. 2017
cellfun( @(Z) find(abs(Z-z_position)<intvl), z, 'uniform', 0)
the output will be a cell array each element of which is the list of indices for the corresponding cell in z.
  9 Kommentare
Walter Roberson
Walter Roberson am 21 Nov. 2017
Do you need to know just the value out of all of the M, or do you need to know which cell of M it came from and the index inside that cell?
Joseph Lee
Joseph Lee am 22 Nov. 2017
Only the min out of all the M, one single value.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by