0254fbb92d18c423ec8b96a8ed1aacc0c1c98568
Michi add sheet 7

Michi authored 11 years ago

1) #Problem 1
2) 
3) #definition of a straight line function
4) y=function(x,m,b) m*x+b
5) 
6) #definition x-Vctor
7) x_vec=seq(-1,3,0.1)
8) 
9) #definition y-vector
Michi new 2 i

Michi authored 11 years ago

10) y_vec=y(x_vec,1,0)
Michi add sheet 7

Michi authored 11 years ago

11) #plotting x-vector vs. y-vector
12) plot(x_vec, y_vec, type="l", col="black", xlab='x',ylab='f(x)=y')
13) 
14) #generating mock data point for 0 <= x <= 2 for 10 equaly spaced points
15) equ_points=10