ECE 323 Matlab demo

Contents

Download source code.

example 1

w = 6.5; % width in mm
h = 4.8; % height in mm
Area = w*h;
fprintf('Area = %g square-mm \n',Area);
Area = 31.2 square-mm 

example 2

resistors in parallel and series

R1 = 500;
R2 = 1000;
Rs = R1 + R2;
Rp = 1/(1/R1 + 1/R2);
fprintf('series %g ohms parallel %g ohms \n',Rs,Rp);
series 1500 ohms parallel 333.333 ohms 

example 3

more resistors

R = [ 1.2 4.8 2.3]*1000;
Rs = sum(R);
Rp = 1/sum(1./R);
fprintf('series %g ohms parallel %g ohms \n',Rs,Rp);
series 8300 ohms parallel 677.301 ohms 

example 4

delta configuration
R = [4.8 3.1 1.2]*1000;
Rs = sum(R(2:3));
R13 = 1/sum(1./[R(1) Rs]);
fprintf('delta resistance (13) %g ohms\n',R13);
delta resistance (13) 2268.13 ohms