seqm.m

来自「计量工具箱」· M 代码 · 共 34 行

M
34
字号
function seq=seqm(a,b,c);% PURPOSE: produce a sequence of values% -----------------------------------------------------% USAGE: y = seqm(a,b,c)%  where    a = initial value in sequence %           b = increment%           c = number of values in the sequence  % -----------------------------------------------------% RETURNS: a sequence, (a a*b ...(a*b^(c-1)))' in MATLAB notation% ----------------------------------------------------- % NOTE: a Gauss compatability function% -----------------------------------------------------% written by:% Peter M. Summers% Melbourne Institute of Applied Economic & Social Research% The University of Melbourne% Parkville, Victoria 3010% Australia% seqm Gauss eqivalent of seqm(a,b,c)seq = zeros(c,1);seq(1) = a; if c>1;   seq(2) = a*b;for i = 3:c;   seq(i) = seq(i-1)*b;end;end;return;

⌨️ 快捷键说明

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