Info

この質問は閉じられています。 編集または回答するには再度開いてください。

subscript assignment to dataset array

3 ビュー (過去 30 日間)
Pinkvirus
Pinkvirus 2015 年 4 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I understand the problem with my code, that chrom{n}(:,k) is a dataset at each level of n. But i do not know how to correctly subscript chrom{n}, to get the data I need to perform the calculation. I could create a new matrix for each n, but I've been scolded about this before so I want to do it properly.
Thanks!
% calculate number of samples
file = diagnoseTargetsfalciparumEvolved2;
[a,b] = size(file);
totalSamples = b-4;
chrom = cell(16,1);
for n = 1:16;
chrom{n} = file(file.chr==n,:);
end
xbar = zeros(16,1);
for n = 1:16;
for k = 4:(totalSamples) + 3;
xbar(n,k-3) = mean(double(chrom{n}(:,k)),1);
end
end
norm = cell(16,1);
for n = 1:16;
norm{n}(:,1:4) = chrom{n}(:,[1:3,14]);
for k = 4:(totalSamples) + 3;
norm{n}(:,k + 1) =chrom{n}(:,k)/(xbar(n,k-3));
end
end

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by