I m处理材料中的非常大的数据,用于在矩阵中储存这些数据。 我用的是逐行储存我的数据,但由于马特拉布特储存数据一栏,我的理解是,按一栏重新调整我的矩阵,使处理速度更快。 我指的是:
<>一般参数>
nbr_channels = 20;
nbr_samples_per_channel = 3200000;
fake_data = randn(1, nbr_samples_per_channel);
ROI = 1200000 : 2800000;
<>/>传输数据
data = nan(nbr_channels, nbr_samples_per_channel);
tic;
for j = 1 : nbr_channels
data(j, 1:nbr_samples_per_channel) = fake_data;
end;
toc;
% Elapsed time is 1.476525 seconds.
return data fromrowmap
tic;
for j = 1 : nbr_channels
bla = data(j, ROI);
end;
toc;
% Elapsed time is 0.572162 seconds.
http://www.ohchr.org。
tic;
for j = 1 : nbr_channels
bla = data(j, :);
end;
toc;
% Elapsed time is 0.589489 seconds.
<>0>按栏目分列的数据
data = nan(nbr_samples_per_channel, nbr_channels);
tic;
for j = 1 : nbr_channels
data(1:nbr_samples_per_channel, j) = fake_data;
end;
toc;
% Elapsed time is 0.299682 seconds.
<>中程>数据
tic;
for j = 1 : nbr_channels
bla = data(ROI, j);
end;
toc;
% Elapsed time is 0.260824 seconds.
<>恢复矩阵表所有数据>
tic;
f or j = 1 : nbr_channels
bla = data(:, j);
end;
toc;
% Elapsed time is 0.092983 seconds.
www.un.org/Depts/DGACM/index_spanish.htm 概述1:
我们能够看到,通过一栏获取数据至少可减少处理时间两倍!
但我不理解为什么囚室效率更高! 举一个例子:
<ssign data by cell
data = cell(1, nbr_samples_per_channel);
tic;
for j = 1 : nbr_channels
data{j} = fake_data;
end;
toc;
% Elapsed time is 0.000013 seconds.
return data from cell range
tic;
for j = 1 : nbr_channels
bla = data{j}(ROI);
end;
toc;
% Elapsed time is 0.260294 seconds.
<>恢复从电池阵列获得的所有数据>
tic;
for j = 1 : nbr_channels
bla = data{j};
end;
toc;
% Elapsed time is 0.000022 seconds.
%%
www.un.org/Depts/DGACM/index_spanish.htm 摘要2:
这是比我在第1部分所显示的更快程度的指令。
<><><><><><>><>>><>>>>>>
为什么在牢房中储存的数据比在矩阵中少?
Question 2
与矩阵相关的工作一般比与电池更容易,因为可以通过矩阵进行。
my_matrix(100:20000,1:3>
but with cells I can t do this (as far as I know). Any alternatives on how to return specific elements from multiple cells at the same time?