summaryrefslogtreecommitdiff
path: root/coursework17/ralston_script.m
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2017-02-20 15:07:39 +0000
committerVasil Zlatanov <v@skozl.com>2017-02-20 15:07:39 +0000
commit07786a8de0f5f5cfc58138fe1f26a489c862f470 (patch)
tree73e5ff498e64e73e03a39dc7bedbfe5165a20dfd /coursework17/ralston_script.m
parent319681662d6598db00ddb371fab8a44a33fd126d (diff)
downloade2-matlab-07786a8de0f5f5cfc58138fe1f26a489c862f470.tar.gz
e2-matlab-07786a8de0f5f5cfc58138fe1f26a489c862f470.tar.bz2
e2-matlab-07786a8de0f5f5cfc58138fe1f26a489c862f470.zip
print all figrures in ex1
Diffstat (limited to 'coursework17/ralston_script.m')
-rw-r--r--coursework17/ralston_script.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/coursework17/ralston_script.m b/coursework17/ralston_script.m
index 9db929f..ce9240a 100644
--- a/coursework17/ralston_script.m
+++ b/coursework17/ralston_script.m
@@ -14,20 +14,23 @@ current_initial=0;
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+figure;
% Signal 2a Vin = 5.5*exp(-t^2/r) V
-Vin = @(t) 5.5*exp(-(t*160*10^(-6))^2) % 5.5V
+Vin = @(t) 5.5*exp(-t^2/(160e-6)) % 5.5V
current_initial=0;
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+figure;
% Signal 2b Vin = 5.5*exp(-t/r)
-Vin = @(t) 5.5*exp(-t*160*10^(-6)) % 5.5V
+Vin = @(t) 5.5*exp(-t/(160e-6)) % 5.5V
current_initial=0;
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+figure;
% Signal 3
T(1) = 20e-6; % 20us
@@ -39,12 +42,15 @@ for j=1:3
Vin = @(t) sin(2*pi*f*t);
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+ figure;
Vin = @(t) sawtooth(2*pi*f*t);
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+ figure;
Vin = @(t) square(2*pi*f*t);
[t, Vout] = ralston(R, L, Vin, current_initial, step, data_points*step);
plot(t, Vout);
+ figure;
end