Octave Basics: Difference between revisions

Jump to navigation Jump to search
2 bytes added ,  1 January 2013
Scrpts => Scripts
(Wiki version of Fotio's GNUOCTAVECARD)
 
(Scrpts => Scripts)
Line 8: Line 8:
<tt>plot | semilogx | semilogy | loglog | contour | quiver | surf | mesh | meshgrid | xlabel | ylabel | zlabel | title | grid | axis | hold | subplot | figure | print</tt>
<tt>plot | semilogx | semilogy | loglog | contour | quiver | surf | mesh | meshgrid | xlabel | ylabel | zlabel | title | grid | axis | hold | subplot | figure | print</tt>
  t = 0:0.01*pi:21*pi; x = sin (t).*(exp (cos (t)) - 2*cos (4*t) + sin (t/12).^5); y = cos (t).*(exp (cos (t)) - 2*cos (4*t) + sin (t/12).^5); plot(x, y) &crarr;
  t = 0:0.01*pi:21*pi; x = sin (t).*(exp (cos (t)) - 2*cos (4*t) + sin (t/12).^5); y = cos (t).*(exp (cos (t)) - 2*cos (4*t) + sin (t/12).^5); plot(x, y) &crarr;
= Scrpts and functions =
= Scripts and functions =
<tt>@ | function | return | nargin | nargout | varargin | varargout | feval | eval</tt>
<tt>@ | function | return | nargin | nargout | varargin | varargout | feval | eval</tt>
  f = @(x) x.^2, f(1:10) &crarr;
  f = @(x) x.^2, f(1:10) &crarr;


  function v = cossum (x, n) v = cumsum (repmat (cos (x), 1, n));
  function v = cossum (x, n) v = cumsum (repmat (cos (x), 1, n));
= Programming elements =
= Programming elements =
<tt>== | > | < | >= | <= | != | | || | | & | && | ! | if | else | elseif | for | while |end | break | continue | pause</tt>
<tt>== | > | < | >= | <= | != | | || | | & | && | ! | if | else | elseif | for | while |end | break | continue | pause</tt>
  for i = 1:5 if (i < 3) disp (i) else disp (i^2) end end &crarr;
  for i = 1:5 if (i < 3) disp (i) else disp (i^2) end end &crarr;
Anonymous user

Navigation menu