Borrar filtros
Borrar filtros

How can I get the cell array's max vaule in each cell?

1 visualización (últimos 30 días)
zb li
zb li el 8 de Dic. de 2018
Respondida: Jan el 9 de Dic. de 2018
Hi everyone,
I have get a cell (1,12) by this code ,each cell have different rows (5000~13000 rows) and 3 column. data.m is my data.
clear all;clc;
folder = 'C:\Users\Dr.Li\\NB1';
cd(folder)
f = fullfile(folder,'*.cxp');
d = dir(f);
for k = 1:numel(d);
data{k} = importfile(fullfile(folder,d(k).name));
putdata{k} = [data{1,k}(214:end,1:3)];
end
CH = {'parameter1','parameter1','parameter1'};
for k = 1:numel(d);
data{k} = importfile(fullfile(folder,d(k).name));
putdata{k} = [CH;data{1,k}(214:end,1:3)];
end
I want get the max value in each cell's first column.,and export the value's row number .
How can I to do?
Thank you
LI

Respuestas (1)

Jan
Jan el 9 de Dic. de 2018
I assume:
maxValue = nan(1, numel(d));
maxIndex = nan(1, numel(d));
for k = 1:numel(d)
[maxValue(k), maxIndex(k)] = max(putdata{k}(:, 1));
end

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by