Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Find minimum for cell arrays

1 view (last 30 days)
Joseph Lee
Joseph Lee on 21 Nov 2017
Closed: Joseph Lee on 23 Nov 2017
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 Comments
Image Analyst
Image Analyst on 22 Nov 2017
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 on 23 Nov 2017
Edited: Joseph Lee on 23 Nov 2017
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.

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!