From 07786a8de0f5f5cfc58138fe1f26a489c862f470 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Mon, 20 Feb 2017 15:07:39 +0000 Subject: print all figrures in ex1 --- coursework17/ralston_script.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'coursework17/ralston_script.m') 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 -- cgit v1.2.3-54-g00ecf