~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/xdess/fcontour2d.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 fcontour2d(xr,yr,f,nz,style,strf,leg,rect,nax,void)
 
2
// deff('[z]=surf(x,y)','z=x**2+y**2');
 
3
// fcontour(surf,-1:0.1:1,-1:0.1:1,10);
 
4
//
 
5
//!
 
6
// Copyright INRIA
 
7
[lhs,rhs]=argn(0);
 
8
if rhs==0,
 
9
  s_mat=['deff(''[z]=surf(x,y)'',''z=x**3+y'');';
 
10
      'fcontour2d(-1:0.1:1,-1:0.1:1,surf,10,style=1:10,rect=[-1,-1,1,1]*1.5,strf='"011"');'];
 
11
  write(%io(2),s_mat);execstr(s_mat);
 
12
  return;
 
13
end;
 
14
if rhs<3,
 
15
  error(' I need at least 3 arguments or zero to have a demo');
 
16
end
 
17
 
 
18
opts=[]
 
19
if exists('nz','local')==0 then nz=10,rhs=rhs+1,end
 
20
if exists('style','local')==1 then opts=[opts,'style=style'],end
 
21
if exists('strf','local')==1 then opts=[opts,'strf=strf'],end
 
22
if exists('leg','local')==1 then opts=[opts,'leg=leg'],end
 
23
if exists('rect','local')==1 then opts=[opts,'rect=rect'],end
 
24
if exists('nax','local')==1 then opts=[opts,'nax=nax'],end
 
25
if exists('frameflag','local')==1 then opts=[opts,'frameflag=frameflag'],end
 
26
if exists('axesflag','local')==1 then opts=[opts,'axesflag=axesflag'],end
 
27
 
 
28
if size(opts,2)<rhs-4 then  error('invalid named arguments'),end
 
29
 
 
30
if type(f)==11 then comp(f),end;
 
31
execstr('contour2d(xr,yr,feval(xr,yr,f),nz,'+strcat(opts,',')+')')
 
32
 
 
33