mrdivide error for cell array divided by constant

2 views (last 30 days)
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 Comments
Geoff Hayes
Geoff Hayes on 7 Apr 2015
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 on 8 Apr 2015
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?

Sign in to comment.

Answers (0)

Categories

Find more on Biomedical Signal Processing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!