📄 ransort.m
字号:
function [ind] = ransort(n)% function [ind] = ransort(n)%% function computes an index vector ind of length n which contains% all integers 1:n but in a quasi random order.%% m-file bitrev must be available% author: m. lang 17.12.91% This is very advantageous for example for the function poly:% compute z = roots([1 zeros(1:m) 1]); p = poly(z).% There is a large error in p, which stems from the second operation% poly. If the roots z are sorted with increasing angle in zs, then% ph = poly(zs(ransort(n))) yields much less error than p.%% ransort uses bitreversal which is known as van der corput sequence% in the theory of uniform distributed sequences.m = ceil(log2(n));ind = 1:2^m;ind = bitrev(ind);ind = ind(find(ind<=n));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -