Matlab Error Message?
Mostrar comentarios más antiguos
I have the below matlab code, and I got this error "Subscripted assignment dimension mismatch"
for s=1:6
x(:,s) = Cr(1,s) .* x2(:,s);
end
Cr is 1x6, x2 is 100x6?
Does anyone know where is the problem?
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 21 de En. de 2016
Editada: Image Analyst
el 21 de En. de 2016
Maybe you're after this: (????)
Cr = rand(1,6);
x2 = rand(100,6);
x = zeros(100, 6); % Preallocate
for row = 1 : size(x2, 1)
x(row, :) = Cr(1:end) .* x2(row,:);
end
x
1 comentario
Ahmed
el 21 de En. de 2016
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!