mrdivide error for cell array divided by constant
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Geoff Hayes
am 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?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!