⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deltax.m

📁 遗传算法的源程序
💻 M
字号:
function y=deltax(x);
%
%	DELTAX(X)
%	
%	Function to return the difference between
%	successive row elements of an array. First
%	element of result array is zero.
%
%   Differs from MATLAB supplied DIFF function.
%   The DIFF function returns an output vector which
%   is one dimension less thant the input vector.
%   Using DELTAX, the dimension of the output vector/matrix
%   is the same as that of the input vector/matrix.
%
%	Called: y = deltax(x)
%
%	    where   x = an vector/matrix to be processed
%
%   Returns:
%
%           	y = [0, x(2)-x(1), x(3)-x(2), ..., x(n)-x(n-1)]
%
%	M.T. Tham (March 1996)
%


[rows,cols]=size(x);
y=zeros(size(x));

i=2:rows;

y(i,:)=x(i,:)-x(i-1,:);


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -