Indexing for cell arrays

1 次查看(过去 30 天)
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]

采纳的回答

Walter Roberson
Walter Roberson 2017-11-20
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 个评论
Walter Roberson
Walter Roberson 2017-11-21
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 2017-11-22
Only the min out of all the M, one single value.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by