3D-Graphiken

Beispiel 1 :

Die Befehle werden hier einzeln abgearbeitet, um bei Octave nicht nach jedem Error den kompletten Code neu eingeben zu müssen.

>> x=-2:0.1:2;
>>[x1,y1] = meshgrid(x,x);
>>z=exp(-x1.^2-y1.^2);
>>mesh(x,x,z);

Output :

Beispiel 2:

r1=0:1/18:1;r2=ones(1,18)-r1(2:19);r=[r1 r2];
>> t=0:pi/9:4*pi;
>> [R,T]=meshgrid(r,t);
>> X=abs(R).*cos(T);Y=abs(R).*sin(T);
>> h=-1:1/18:1;
>> [H,T]=meshgrid(h,t);
>> Z=sign(H).*sqrt(1-R.^2);
>> surface(X,Y,Z),axis equal,view(3)  

	 Funktioniert nicht bei Octave

	 Kontrolliere den Code Zeile für Zeile und überlege, was passiert:!

>> r1=0:1/8:1;
>> r1
r1 =

 Columns 1 through 9:

  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000

>> r21=ones                                                                                       
r21 = 1
>> r21=ones(1,8)
r21 =

        1        1        1        1        1        1        1        1

>> r11=r1(2:9)
r11 =

  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000

>> r2=r21-r11
r2 =

  0.87500  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000

>> r=[r1 r2]
r =

 Columns 1 through 10:

  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500

 Columns 11 through 17:

  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000

>> t=0:pi/9:2*pi
t =

 Columns 1 through 10:

  0.00000  0.34907  0.69813  1.04720  1.39626  1.74533  2.09440  2.44346  2.79253  3.14159

 Columns 11 through 19:

  3.49066  3.83972  4.18879  4.53786  4.88692  5.23599  5.58505  5.93412  6.28319

>> [R T]=meshgrid(r,t)
R =

 Columns 1 through 10:

  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500
  0.00000  0.12500  0.25000  0.37500  0.50000  0.62500  0.75000  0.87500  1.00000  0.87500

 Columns 11 through 17:

  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000
  0.75000  0.62500  0.50000  0.37500  0.25000  0.12500  0.00000

T =

 Columns 1 through 10:

  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907
  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813
  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720
  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626
  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533
  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440
  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346
  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253
  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159
  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066
  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972
  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879
  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786
  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692
  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599
  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505
  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412
  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319

 Columns 11 through 17:

  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907
  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813
  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720
  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626
  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533
  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440
  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346
  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253
  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159
  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066
  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972
  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879
  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786
  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692
  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599
  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505
  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412
  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319

>> X=abs(R).*cos(T)
X =

 Columns 1 through 9:

   0.00000   0.12500   0.25000   0.37500   0.50000   0.62500   0.75000   0.87500   1.00000
   0.00000   0.11746   0.23492   0.35238   0.46985   0.58731   0.70477   0.82223   0.93969
   0.00000   0.09576   0.19151   0.28727   0.38302   0.47878   0.57453   0.67029   0.76604
   0.00000   0.06250   0.12500   0.18750   0.25000   0.31250   0.37500   0.43750   0.50000
   0.00000   0.02171   0.04341   0.06512   0.08682   0.10853   0.13024   0.15194   0.17365
  -0.00000  -0.02171  -0.04341  -0.06512  -0.08682  -0.10853  -0.13024  -0.15194  -0.17365
  -0.00000  -0.06250  -0.12500  -0.18750  -0.25000  -0.31250  -0.37500  -0.43750  -0.50000
  -0.00000  -0.09576  -0.19151  -0.28727  -0.38302  -0.47878  -0.57453  -0.67029  -0.76604
  -0.00000  -0.11746  -0.23492  -0.35238  -0.46985  -0.58731  -0.70477  -0.82223  -0.93969
  -0.00000  -0.12500  -0.25000  -0.37500  -0.50000  -0.62500  -0.75000  -0.87500  -1.00000
  -0.00000  -0.11746  -0.23492  -0.35238  -0.46985  -0.58731  -0.70477  -0.82223  -0.93969
  -0.00000  -0.09576  -0.19151  -0.28727  -0.38302  -0.47878  -0.57453  -0.67029  -0.76604
  -0.00000  -0.06250  -0.12500  -0.18750  -0.25000  -0.31250  -0.37500  -0.43750  -0.50000
  -0.00000  -0.02171  -0.04341  -0.06512  -0.08682  -0.10853  -0.13024  -0.15194  -0.17365
   0.00000   0.02171   0.04341   0.06512   0.08682   0.10853   0.13024   0.15194   0.17365
   0.00000   0.06250   0.12500   0.18750   0.25000   0.31250   0.37500   0.43750   0.50000
   0.00000   0.09576   0.19151   0.28727   0.38302   0.47878   0.57453   0.67029   0.76604
   0.00000   0.11746   0.23492   0.35238   0.46985   0.58731   0.70477   0.82223   0.93969
   0.00000   0.12500   0.25000   0.37500   0.50000   0.62500   0.75000   0.87500   1.00000

 Columns 10 through 17:

   0.87500   0.75000   0.62500   0.50000   0.37500   0.25000   0.12500   0.00000
   0.82223   0.70477   0.58731   0.46985   0.35238   0.23492   0.11746   0.00000
   0.67029   0.57453   0.47878   0.38302   0.28727   0.19151   0.09576   0.00000
   0.43750   0.37500   0.31250   0.25000   0.18750   0.12500   0.06250   0.00000
   0.15194   0.13024   0.10853   0.08682   0.06512   0.04341   0.02171   0.00000
  -0.15194  -0.13024  -0.10853  -0.08682  -0.06512  -0.04341  -0.02171  -0.00000
  -0.43750  -0.37500  -0.31250  -0.25000  -0.18750  -0.12500  -0.06250  -0.00000
  -0.67029  -0.57453  -0.47878  -0.38302  -0.28727  -0.19151  -0.09576  -0.00000
  -0.82223  -0.70477  -0.58731  -0.46985  -0.35238  -0.23492  -0.11746  -0.00000
  -0.87500  -0.75000  -0.62500  -0.50000  -0.37500  -0.25000  -0.12500  -0.00000
  -0.82223  -0.70477  -0.58731  -0.46985  -0.35238  -0.23492  -0.11746  -0.00000
  -0.67029  -0.57453  -0.47878  -0.38302  -0.28727  -0.19151  -0.09576  -0.00000
  -0.43750  -0.37500  -0.31250  -0.25000  -0.18750  -0.12500  -0.06250  -0.00000
  -0.15194  -0.13024  -0.10853  -0.08682  -0.06512  -0.04341  -0.02171  -0.00000
   0.15194   0.13024   0.10853   0.08682   0.06512   0.04341   0.02171   0.00000
   0.43750   0.37500   0.31250   0.25000   0.18750   0.12500   0.06250   0.00000
   0.67029   0.57453   0.47878   0.38302   0.28727   0.19151   0.09576   0.00000
   0.82223   0.70477   0.58731   0.46985   0.35238   0.23492   0.11746   0.00000
   0.87500   0.75000   0.62500   0.50000   0.37500   0.25000   0.12500   0.00000

>> 
>> Y=abs(R).*sin(T)
Y =

 Columns 1 through 9:

   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
   0.00000   0.04275   0.08551   0.12826   0.17101   0.21376   0.25652   0.29927   0.34202
   0.00000   0.08035   0.16070   0.24105   0.32139   0.40174   0.48209   0.56244   0.64279
   0.00000   0.10825   0.21651   0.32476   0.43301   0.54127   0.64952   0.75777   0.86603
   0.00000   0.12310   0.24620   0.36930   0.49240   0.61550   0.73861   0.86171   0.98481
   0.00000   0.12310   0.24620   0.36930   0.49240   0.61550   0.73861   0.86171   0.98481
   0.00000   0.10825   0.21651   0.32476   0.43301   0.54127   0.64952   0.75777   0.86603
   0.00000   0.08035   0.16070   0.24105   0.32139   0.40174   0.48209   0.56244   0.64279
   0.00000   0.04275   0.08551   0.12826   0.17101   0.21376   0.25652   0.29927   0.34202
   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
  -0.00000  -0.04275  -0.08551  -0.12826  -0.17101  -0.21376  -0.25652  -0.29927  -0.34202
  -0.00000  -0.08035  -0.16070  -0.24105  -0.32139  -0.40174  -0.48209  -0.56244  -0.64279
  -0.00000  -0.10825  -0.21651  -0.32476  -0.43301  -0.54127  -0.64952  -0.75777  -0.86603
  -0.00000  -0.12310  -0.24620  -0.36930  -0.49240  -0.61550  -0.73861  -0.86171  -0.98481
  -0.00000  -0.12310  -0.24620  -0.36930  -0.49240  -0.61550  -0.73861  -0.86171  -0.98481
  -0.00000  -0.10825  -0.21651  -0.32476  -0.43301  -0.54127  -0.64952  -0.75777  -0.86603
  -0.00000  -0.08035  -0.16070  -0.24105  -0.32139  -0.40174  -0.48209  -0.56244  -0.64279
  -0.00000  -0.04275  -0.08551  -0.12826  -0.17101  -0.21376  -0.25652  -0.29927  -0.34202
  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000

 Columns 10 through 17:

   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
   0.29927   0.25652   0.21376   0.17101   0.12826   0.08551   0.04275   0.00000
   0.56244   0.48209   0.40174   0.32139   0.24105   0.16070   0.08035   0.00000
   0.75777   0.64952   0.54127   0.43301   0.32476   0.21651   0.10825   0.00000
   0.86171   0.73861   0.61550   0.49240   0.36930   0.24620   0.12310   0.00000
   0.86171   0.73861   0.61550   0.49240   0.36930   0.24620   0.12310   0.00000
   0.75777   0.64952   0.54127   0.43301   0.32476   0.21651   0.10825   0.00000
   0.56244   0.48209   0.40174   0.32139   0.24105   0.16070   0.08035   0.00000
   0.29927   0.25652   0.21376   0.17101   0.12826   0.08551   0.04275   0.00000
   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000
  -0.29927  -0.25652  -0.21376  -0.17101  -0.12826  -0.08551  -0.04275  -0.00000
  -0.56244  -0.48209  -0.40174  -0.32139  -0.24105  -0.16070  -0.08035  -0.00000
  -0.75777  -0.64952  -0.54127  -0.43301  -0.32476  -0.21651  -0.10825  -0.00000
  -0.86171  -0.73861  -0.61550  -0.49240  -0.36930  -0.24620  -0.12310  -0.00000
  -0.86171  -0.73861  -0.61550  -0.49240  -0.36930  -0.24620  -0.12310  -0.00000
  -0.75777  -0.64952  -0.54127  -0.43301  -0.32476  -0.21651  -0.10825  -0.00000
  -0.56244  -0.48209  -0.40174  -0.32139  -0.24105  -0.16070  -0.08035  -0.00000
  -0.29927  -0.25652  -0.21376  -0.17101  -0.12826  -0.08551  -0.04275  -0.00000
  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000  -0.00000

>> h=-1:1/9:1
h =

 Columns 1 through 9:

  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111

 Columns 10 through 18:

  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889

 Column 19:

   1.00000

>> [H T]=meshgrid(h,t)
H =

 Columns 1 through 9:

  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111
  -1.00000  -0.88889  -0.77778  -0.66667  -0.55556  -0.44444  -0.33333  -0.22222  -0.11111

 Columns 10 through 18:

  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889
  -0.00000   0.11111   0.22222   0.33333   0.44444   0.55556   0.66667   0.77778   0.88889

 Column 19:

   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000
   1.00000

T =

 Columns 1 through 10:

  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907
  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813
  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720
  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626
  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533
  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440
  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346
  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253
  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159
  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066
  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972
  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879
  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786
  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692
  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599
  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505
  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412
  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319

 Columns 11 through 19:

  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000  0.00000
  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907  0.34907
  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813  0.69813
  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720  1.04720
  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626  1.39626
  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533  1.74533
  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440  2.09440
  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346  2.44346
  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253  2.79253
  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159  3.14159
  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066  3.49066
  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972  3.83972
  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879  4.18879
  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786  4.53786
  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692  4.88692
  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599  5.23599
  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505  5.58505
  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412  5.93412
  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319  6.28319

Z=sign(H).*sqrt(1-R.^2);   funktioniert nicht in Oktave

>> Z=sign(H)*sqrt(1-R.^2)
Z =

 Columns 1 through 9:

  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000
  -1.00000  -0.99216  -0.96825  -0.92702  -0.86603  -0.78062  -0.66144  -0.48412   0.00000

 Columns 10 through 17:

  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000
  -0.48412  -0.66144  -0.78062  -0.86603  -0.92702  -0.96825  -0.99216  -1.00000

>> 
surface(X,Y,Z),axis equal,view(3)
parse error:                                              
	
	 Funktioniert nicht

Folgender Code funktioniert:

>> mesh(X,Y,Z)

>> title('Plot')
>> replot

Beispiel 3:

r1=0:1/8:1;
r21=ones(1,8);
r2=r21-r1(2:9);
r=[r1 r2];
 t=pi:pi/9:3*pi;
[R,T]=meshgrid(r,t);
X=abs(R).*cos(T);Y=abs(R).*sin(T);
h=-1:1/9:1;
[H,T]=meshgrid(h,t);
Z=sign(H).*sqrt(1-R.^2);
mesh(Z,X,Y)

Eine gute Anleitung für Octave (oft in Form gelöster Übungen) findet man unter:

http://homepages.uni-tuebingen.de/juergen.schweizer/Octave.html