Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Find minimum for cell arrays

1 visualizzazione (ultimi 30 giorni)
Joseph Lee
Joseph Lee il 21 Nov 2017
Chiuso: Joseph Lee il 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 Commenti
Image Analyst
Image Analyst il 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 il 23 Nov 2017
Modificato: Joseph Lee il 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.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by