From help-octave-request at bevo dot che dot wisc dot edu Mon Jan 24 09:33:12 2000 Subject: Re: follow a simple Matlab program but not work on octave2.0.14 From: Ben Sapp To: eric CC: help-octave at bevo dot che dot wisc dot edu Date: Mon, 24 Jan 2000 08:33:08 -0700 eric wrote: > ------------------------------------------------------------------------ > %VECROT Animation program which shows a rotating vector > % defined as a complex number > f = 50; % frequency, Hz > omega = 2*pi*f; % angular frequency, rad/s > tmax = 1/50; % time for a complete rotation, s > time = [ ]; > motion = [ ]; > axis('square') Simply remove the above line and it will work in Octave. > axis([-1 1 -1 1]) > for t=0: tmax/36: tmax > z = exp(i*omega*t); %complex number description > x = real(z); % Cartesian projections > y = imag(z); > time = [ time t]; > motion = [motion y]; > plot([0, x], [0, y]) > pause(1.0) > end -- Ben Sapp Los Alamos National Laboratory email: Phone: (505)667-3277 Fax: (505)665-7920 URL: http://www.neutrino.lanl.gov/ -- ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------