12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

48 <strong>GNU</strong> <strong>Octave</strong>octave:1> x.b.d = 3x.b.d = 3octave:2> x.bans ={d = 3}octave:3> xx ={a = 1b ={d = 3}}c = stringNote that when <strong>Octave</strong> prints the value of a structure that contains other structures,only a few levels are displayed. For example,octave:1> a.b.c.d.e = 1;octave:2> aa ={b ={c ={d: 1x1 struct}}}This prevents long and confusing output from large deeply nested structures.struct levels to printBuilt-in VariableYou can tell <strong>Octave</strong> how many structure levels to display by setting the built-invariable struct_levels_to_print. The default value is 2.Functions can return structures. For example, the following function separates the realand complex parts of a matrix and stores them in two elements of the same structurevariable.octave:1> function y = f (x)> y.re = real (x);> y.im = imag (x);> endfunctionWhen called with a complex-valued argument, f returns the data structure containingthe real and imaginary parts of the original function argument.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!