Why am I getting: Error using sum - Invalid option. Option must be 'double', 'native', 'default', 'omitnan', or 'includenan'.
22 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
lil brain
el 24 de Mzo. de 2022
Comentada: lil brain
el 24 de Mzo. de 2022
Hi,
I have this for loop:
n = numel(cell_of_doubles);
distances_1 = cell(1,n);
for dd = 1:n
distances_1{dd} = sqrt(sum(cell_of_doubles{dd}(:,1:3),1,1).^2);
end
Whenever I try to run it I get the error,
Error using sum
Invalid option. Option must be 'double', 'native', 'default', 'omitnan', or 'includenan'.
It isn't clear to me why that is since my cell of doubles array is a double.
Does anyone know how I can solve this?
0 comentarios
Respuesta aceptada
KSSV
el 24 de Mzo. de 2022
Repalce this line:
distances_1{dd} = sqrt(sum(cell_of_doubles{dd}(:,1:3),1,1).^2);
with
distances_1{dd} = sqrt(sum(cell_of_doubles{dd}(:,1:3),1).^2);
Más respuestas (0)
Ver también
Categorías
Más información sobre Descriptive Statistics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!