
B = CIRCSHIFT(A,SHIFTSIZE) circularly shifts the values in the array A
by SHIFTSIZE elements. SHIFTSIZE is a vector of integer scalars (整数标锋卜量组成誉御的矢量银虚穗)where
the N-th element specifies the shift amount for the N-th dimension of
array A. If an element in SHIFTSIZE is positive, the values of A are
shifted down (or to the right). If it is negative, the values of A
are shifted up (or to the left).
Examples:
A = [ 1 2 3 4 5 6 7 8 9]
B = % circularly shifts first dimension values down by 1. B = 7 8 9
1 2 3
4 5 6
B = circshift(A,[1 -1]) % circularly shifts first dimension values down by 1 and second dimension left by 1.
B = 8 9 7
2 3 1
5 6 4
x1_shift_right1(1:10) = 0%%% 给x1_shift_right1赋初孝卜亏始值,全部为0结果:
x1_shift_right1 =
0 0 0 0 0 0 0 0 0 0
x1_shift_right1(2:10) = x1(1:9) %%%% 将x1的第1到9个数值赋值给弊链x1_shift_right1第2 到第10个值巧神
如
>>x1=randint(1,10,[0,10])
x1 =
9 9 510 3 5 8 0 0 1
>>x1_shift_right1(2:10) = x1(1:9)
x1_shift_right1 =
0 9 9 510 3 5 8 0 0
需要链扒把时间映射到对应的数组元素的慧唤蠢序号比如你的时间点式0:dt:N*dt
对应的数组元素的编号是1,2,3,。。。。
所以要实现kTs的位移就是把kTs/dt号前陪的元素移到第一个,一次类推
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)