You are on page 1of 3

Machine Learning Example 2

clc
clear
close all
x=load('ex2x.dat');
y=load('ex2y.dat');
figure
plot(x,y,'o')

ylabel('Height in meters')
xlabel('Age in years')

m = length(y); % store the size of data


x = [ ones(m,1),x]; %add a column to the x

%% linear regresion
theta = [0 0];
ss_old =theta;
ss_new = [inf inf];
alpha = 0.007;
while (abs(ss_new-ss_old)>0.0000000001)
ss_old = ss_new;
h_the = x*theta'; % prediction
theta(1)=theta(1)-alpha*(1/m).*sum(((h_the-y) .* x(:,1)));
theta(2)=theta(2)-alpha*(1/m).*sum(((h_the-y) .* x(:,2)));

MATCHING NETWORKS AND SIGNAL FLOW GRAPHS


2.1 Introduction, 92
2.2 The Smith Chart, 93
2.3 .The Normalized Impedance and Admittance
Smith Chart, 105
2.4 Impedance Matching Networks, 112
2.5 Microstrip Matching Networks, 141
Microstrip Lines, 141
Design ofMatching Ne!works, 152
2.6 Signal Flow Graphs and Applications, 175
Applications ofSignal Flow Graphs, 180
2.7 Power-Gain Expressions: Alternate
Derivations, 185
Power-Gain Expressions in Terms ofSp
parameters, 192
2.8 VSWR Calculations, 194
Problems, 200
3 MICROWAVE TRANSISTOR AMPLIFIER DESIGN
3.1 Introduction, 212
3.2 Power Gain Equations, 213
3.3 Stability Considerations, 217
3.4 Constant-Gain Circles: Unilateral Case, 228
Unconditionally Stable Case, ISi;1 < 1, 231
Potentially Unstable Case, ISi;1 > 1, 234
3.5 Unilateral Figure of Merit, 238
3.6 Simultaneous Conjugate Match:

Bilateral Case, 240


3.7 Operating and Available Power-Gain Circles, 247
Operating Power-Gain Circles, 247
Unconditionally stable bilateral case, 247
Potentially unstable bilateral case, 252
Available Power-Gain Circles, 257
Unconditionally stable bilateral case, 257
Potentially unstable bilateral case, 260
3.8 Constant VSWR Circles, 260
3.9 DC Bias Networks, 273
BIT Bias Networks, 273
GaAs FET Bias Networks, 280
ss_new=theta;
end
hold on
plot(x(:,2), x*theta', '-') % remember that x is now a matrix with 2 columns
% and the second column contains the time info

legend('Training data', 'Linear regression')


theta
[1 3.5]*theta'
[1 7]*theta'

You might also like