mrdivide error for cell array divided by constant

4 visualizaciones (últimos 30 días)
Pinkvirus
Pinkvirus el 7 de Abr. de 2015
Comentada: Pinkvirus el 8 de Abr. de 2015
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 comentarios
Geoff Hayes
Geoff Hayes el 7 de Abr. de 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 el 8 de Abr. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by