Info

此问题已关闭。 请重新打开它进行编辑或回答。

Find minimum for cell arrays

1 次查看(过去 30 天)
Joseph Lee
Joseph Lee 2017-11-21
关闭: Joseph Lee 2017-11-23
P & z are both 10x1300 cell arrays, how do i find the minimum P value at z=1 after i obtained the index, eg.
Columns 1297 through 1300
[1×23 double] [1×29 double] [1×23 double] [1×25 double]
[1×25 double] [1×25 double] [1×25 double] [1×27 double]
[1×25 double] [1×27 double] [1×27 double] [1×25 double]
[1×29 double] [1×29 double] [1×25 double] [1×23 double]
[1×25 double] [1×23 double] [1×27 double] [1×27 double]
[1×27 double] [1×23 double] [1×21 double] [1×23 double]
[1×29 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×21 double] [1×27 double]
[1×25 double] [1×25 double] [1×25 double] [1×23 double]
index=cellfun( @(Z) find(abs(Z-1)<0.005), z, 'uniform', 0);
index results Columns 1297 through 1300
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
[ 25] [1×2 double] [1×2 double] [1×2 double]
[1×2 double] [1×2 double] [1×2 double] [1×2 double]
[1×2 double] [1×2 double] [1×2 double] [1×2 double]
[1×0 double] [1×0 double] [1×2 double] [1×2 double]
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
[1×0 double] [1×0 double] [1×0 double] [1×0 double]
min_P=min(P(index)) < how do i change this such that the minimum of all P values from index can be found.
  2 个评论
Image Analyst
Image Analyst 2017-11-22
You forgot to attach P and z in a .mat file, so how can people try any code to help you?
Joseph Lee
Joseph Lee 2017-11-23
编辑:Joseph Lee 2017-11-23
You can consider them as just random numbers, its a long code of calculations to get P and z. They're the same size, you can even consider P as z, it is simply just the reverse of
cellfun( @(Z) find(abs(Z-1)<0.005), z, 'uniform', 0);
You have already seen the previous step to this. I just need to find the minimum among different sized cells, I dont think the exact data is required.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by