Suppose x is a 1*n vector and m<n.
Define a new 1*(n-m+1) vector y whose i-th element y(i)=f(x(i:i-1+m)) where
f() is a single valued function.The straight code to construct y is as
follows.
y=zeros(1,n-m+1);
for i=1:n-m+1
y(i)=f(x(i:i-1+m))
end
Is there any code without for-end loop?
Best regards
--
View this message in context:
http://mailinglists.scilab.org/efficient-calculation-for-a-moving-window-tp4035997.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users