Revision [4169]
This is an old revision of OctavePlots made by ToBo on 2008-07-16 01:07:41.
Octave Plots
Plot löschen
clearplot
Clear current figure
clf
Beschriftung
Farben
Fromatierung
Number Gnuplot colors (lines)points style 1 red * 2 green + 3 blue o 4 magenta x 5 cyan house 6 brown there exists
Ordentlicher Plot
figure(1)
x=linspace(-1.5,1.5,50);
y1=exp(x);
y2=exp(-x);
y3=1-exp(-x);
y=[y1;y2;y3];
hold off
plot(x,y);
legend('y_1','y2','y3');
xlabel('x');
ylabel('y');
title('Exponentialfunktion')
grid on
x=linspace(-1.5,1.5,50);
y1=exp(x);
y2=exp(-x);
y3=1-exp(-x);
y=[y1;y2;y3];
hold off
plot(x,y);
legend('y_1','y2','y3');
xlabel('x');
ylabel('y');
title('Exponentialfunktion')
grid on
Wenn vielen Figures gezeichnet werden, verhält sich OCATVE anders als MATLAB
grid on % Bei octave besser explizit grid on anstelle von grid anngeben
Output plot to file
> gset terminal png
> gset output "1.png"
> redraw
> gset output "1.png"
> redraw
png, emf, postscript
Beispiel
fmax = 5000;
fmin = 0;
f = linspace(fmin,fmax,100);
w = 2*pi*f;
C = 2 * 10 ^ - 6;
L = 20 * 10 ^ -3;
X_C = 1 ./ (w * C);
X_L = w * L;
plot(f, X_C, 'b');
hold on;
plot(f, X_L, 'g');
plot(f, X_L + X_C, 'r');
plot(f, (X_L .* X_C)./(X_L + X_C), 'm');
hold off
legend('C','L','C+L','C||L')
axis([fmin fmax 0 400])
ylabel('f [Hz]')
xlabel('R [Ohm]')
fmin = 0;
f = linspace(fmin,fmax,100);
w = 2*pi*f;
C = 2 * 10 ^ - 6;
L = 20 * 10 ^ -3;
X_C = 1 ./ (w * C);
X_L = w * L;
plot(f, X_C, 'b');
hold on;
plot(f, X_L, 'g');
plot(f, X_L + X_C, 'r');
plot(f, (X_L .* X_C)./(X_L + X_C), 'm');
hold off
legend('C','L','C+L','C||L')
axis([fmin fmax 0 400])
ylabel('f [Hz]')
xlabel('R [Ohm]')
Siehe auch