Thanks Jos for the comment, I didn't know about the hankel function.
Had I known, I would have definitely done it that way (as indexing always works better in Matlab).
I am quite surprised, though, that there is no function in the standard library for producing such a common matrix.
I will gladly do, but I thought that the description "The function accepts both column and row vectors and produces the circulant matrix associated." would suffice.
The author should be commended for adding a good help section. Although faster and better algorithms exist, I concur with Husam A. that this is indeed a nice effort, and therefor happily raise my rating.
Thanks Jos for the comment, I didn't know about the hankel function.
Had I known, I would have definitely done it that way (as indexing always works better in Matlab).
I am quite surprised, though, that there is no function in the standard library for producing such a common matrix.
The author should be commended for adding a good help section. Although faster and better algorithms exist, I concur with Husam A. that this is indeed a nice effort, and therefor happily raise my rating.
Thanks Jos for the comment, I didn't know about the hankel function.
Had I known, I would have definitely done it that way (as indexing always works better in Matlab).
I am quite surprised, though, that there is no function in the standard library for producing such a common matrix.
Some indexing will give you the same result
V = IN(:) ;
idx = hankel(1:numel(V),0:numel(V)-1)
% idx = hankel(1:numel(V)) + hankel(zeros(1,numl(V)),0:numel(V)-1)
OUT = V(ix) ;
Comment only