n = size(log_data,1);
log_data = log_data([4001:n,1:4000], :);

Rafael

-----Original Message-----
From: users [mailto:[email protected]] On Behalf Of Samuel Gougeon
Sent: Thursday, November 09, 2017 12:06 PM
To: Users mailing list for Scilab <[email protected]>
Subject: Re: [Scilab-users] Shift indices

Le 08/11/2017 à 15:07, Richard llom a écrit :
> Hello,
> is there a function available to shift indices?
> E.g. I have
> aa = [1:10]
> and want
> bb =  6.   7.   8.   9.   10.   1.   2.   3.   4.   5.
>
> This is what I come up with:
> log_data2 = zeros(log_data);
> log_data2 = log_data(4001:size(log_data,1),:);
> log_data2((size(log_data,1)-4000+1):size(log_data,1),:) =
> log_data(1:4000,:);
>
> But I'm wondering if there is a prettier solution?

n = size(log_data,1);
log_data = log_data(modulo((1:n)-2+4001, n)+1, :);

Samuel
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to