~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/util/linspace.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function y = linspace(d1, d2, n)
 
2
// Linearly spaced vector.
 
3
// linspace(x1, x2) generates a row vector of 100 linearly
 
4
// equally spaced points between x1 and x2.
 
5
// linspace(x1, x2, n) generates n points between x1 and x2.
 
6
// Copyright INRIA
 
7
[nargout,nargin]=argn(0)
 
8
if nargin == 2
 
9
    n = 100;
 
10
end
 
11
y = [d1*ones(1,n-1)+(0:n-2)*(d2-d1)/(n-1),d2];