[Scilab-users] Matrix copy

Serge Steer Serge.Steer at inria.fr
Wed Oct 17 09:22:40 CEST 2012


Moreover note that the loops

for m = 1 : 76
     for i = 1*m : 8*m
for j = 1 : 16
    for k = 1 : 3
Im2(i,j,k)=Im(i,j,k);
   end;
end;
   end;
end;


can be replaced by a much more efficient code:

i = 1:(m*8);
j = 1 : 16;
k = 1 : 3;
Im2(i,j,k)=Im(i,j,k);


Serge Steer

Le 16/10/2012 12:49, Eric Dubois a écrit :
>
> stacksize('max') may help.
>
> Éric
>
> Le 16 oct. 2012 12:21, "Anton Julio" <o_nire at yahoo.it 
> <mailto:o_nire at yahoo.it>> a écrit :
>
>     Hi,
>     I'm using IPD and SIVP, This is my code
>
>     Im = imread('C:\Users\Pictures\Lion2.png');
>
>     [h,l,c]=size(Im);
>     Im2 = zeros(h,l,c);
>     for m = 1 : 76
>         for i = 1*m : 8*m
>         for j = 1 : 16
>             for k = 1 : 3
>                 Im2(i,j,k)=Im(i,j,k);
>             end;
>         end;
>     end;
>     end;
>     imshow(Im2);
>
>     and error message
>
>      !--error 17
>     : stack size exceeded (Use stacksize function to increase it).
>     at line     100 of function generic_i_hm called by :
>     at line       5 of function %i_i_hm called by :
>         Im2(i,j,k)=a;
>     at line      17 of exec file called by :
>     exec('C:\Users\Pictures\Mosaic.sce', -1)
>
>     Thank you
>
>
>     _______________________________________________
>     users mailing list
>     users at lists.scilab.org <mailto:users at lists.scilab.org>
>     http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20121017/1f4e1807/attachment.htm>


More information about the users mailing list