mrdivide error for cell array divided by constant

4 ビュー (過去 30 日間)
Pinkvirus
Pinkvirus 2015 年 4 月 7 日
コメント済み: Pinkvirus 2015 年 4 月 8 日
Hi, I'm trying to divide values in a cell array by a constant in a vector:
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,totalSamples);
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
The last section which creates the cell called norm, is where I get the following error:
Undefined function 'mrdivide' for input arguments of type 'dataset'.
Error in diagnoseTargets_falciparum (line 22) norm{n}(:,k + 1) = chrom{n}(:,k)/xbar(n,k-3);
neither chrom or xbar are datasets. chrom is a cell array and xbar is a matrix.
Anyone know why I am getting this error? or how to fix it?
Thanks!
  2 件のコメント
Geoff Hayes
Geoff Hayes 2015 年 4 月 7 日
Pinkvirus - put a breakpoint at the line
norm{n}(:,k + 1) = chrom{n}(:,k)/xbar(n,k-3);
and run your code. When the debugger pauses at the above line look at chrom{n}(:,k) and xbar(n,k-3). What are the data types for each?
Pinkvirus
Pinkvirus 2015 年 4 月 8 日
Geoff
chrom{n}(:,k) is dataset and xbar(n,k-3) is double
now I see, thank-you.
But, how to make it so inside the cell array, chrom{n}(:,k) is not a dataset?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by