Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
subscript assignment to dataset array
조회 수: 3 (최근 30일)
이전 댓글 표시
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!