I am getting Subscripted assignment dimension mismatch in the following code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Boris
el 25 de Mzo. de 2014
Comentada: Boris
el 25 de Mzo. de 2014
I am getting Subscripted assignment dimension mismatch error in the following code:
Error in (line 18) ntscIm(:,:,1)=sgI(:,:,1);
Can you help me please, how can I fix this?
g_name='example.bmp';
c_name='example_marked.bmp';
out_name='example_out.bmp';
%
%
solver=2;
gI=double(imread(g_name))/255;
cI=double(imread(c_name))/255;
colorIm=(sum(abs(gI-cI),3)>0.01);
colorIm=double(colorIm);
sgI=rgb2ntsc(gI);
scI=rgb2ntsc(cI);
ntscIm(:,:,1)=sgI(:,:,1);
ntscIm(:,:,2)=scI(:,:,2);
ntscIm(:,:,3)=scI(:,:,3);
0 comentarios
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 25 de Mzo. de 2014
Are you looping over this sequence? So ntscIm might already have a value from the last time through the loop? And that value might happen to be a different array size?
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices 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!