필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
zb li
zb li 2018년 12월 8일
답변: Jan 2018년 12월 9일
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

답변 (1개)

Jan
Jan 2018년 12월 9일
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

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by