Schritte in MATLAB oder Octave

(Plots)

Die folgende Octave-Session bezieht sich auf das momentan verwendete Skirpt lin.Alg.+Geom.-Seiten 17 ff.

Probiere, die folgenden Sequenzen am Computer aus. 

>> x=linspace(0,2*pi,50); y=sin(sin(x)); plot(x,y)
>>                                                      (Einteilung der x-Achse, y-Wert definieren, Plot)

>> plot(x,y,':',x,cos(x),'g')                   (Zwei Funktionen in ein Diagramm ploten, Farbwahl)

>> grid                                              (Im nächsten Plot Gitter aktivieren)

>> plot(x,cos(x))                                (Plot)

>> xlabel('Variable x')                        (Im nächsten Plot x-Achse beschriften)

>> z=sin(sin(x)).^2;                           (Funktion definieren)
 
>> hold on;plot(x,z,'r')                       (Plot über den alten Plot legen, rot)

>> hold off                                       (Uebereinanderlegen abschalten)

>> subplot(2,1,1)     
(Graphikfenster mit Unterfenster in 2 Zeilen, 1 Spalte erzeugen, 1. Unterfenster aktivieren, Problem in Octave) 

>> plot(x,y)                                       (Plot ins 1. Unterfenster)
                              
>> subplot(2,1,2)
(Graphikfenster mit Unterfenster in 2 Zeilen, 1 Spalte erzeugen, 2. Unterfenster aktivieren, Problem in Octave) 

>> plot(x,z)                                       (Plot ins 2. Unterfenster)

>> clf                                                (Graphikfenster löschen)

>> figure 
ans = 1
>> figure;                                           (Leeres Fenster öffnen)

>> h = plot(x,sin(x.^2));             (Grafik als Objekt in h speichern - Problem in Octave)

error: value on right hand side of assignment is undefined
error: evaluating assignment expression near line 4, column 3

>> get(h)                                   (Ploteigenschaften anzeigen - Problem in Octave)

error: `get' undefined near line 4 column 1

>> set(h,'Color',[1 0 1],'LineWith',2)      (Graphikeigenschaften ändern - Problem in Octave)

error: `h' undefined near line 4 column 5
error: evaluating argument list element number 1

>> help print     (Info Graphik ausdrucken resp. an LPT1 schicken - vgl. Skript TU München)

print is the user-defined function from the file
/usr/share/octave/2.1.42/m/plot/print.m

Copyright (C) 1999 Daniel Heiserer
Copyright (C) 2001 Laurent Mazet

This program is free software; it is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this file; see the file COPYING.  If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.

Additional help for built-in functions, operators, and variables
is available in the on-line version of the manual.  Use the command
`help -i <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the help-octave@bevo.che.wisc.edu
mailing list.