如何在Matlab中将1:10的矢量翻转到10:1?

时间:2013-01-28 11:44:06

标签: matlab math

假设我有'1 2 3'。我想得到'3 2 1'。我怎样才能在Matlab中获得它?

更详细的例子

N=64;
[x y]=meshgrid(linspace(-3*pi,3*pi,N),linspace(-3*pi,3*pi,N));
t=sqrt(x.^2+y.^2);

% Now instead of "f=t+2*sinc(t);", I want to get all elements inverted aka 
% first element becomes the last and so on -- I thought it would be 
% sinc(abs(length(t)-t)) but it is not.

1 个答案:

答案 0 :(得分:6)

使用MATLAB函数fliplr