[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Polynom, 2. degree
From: |
Peter Stalder |
Subject: |
Polynom, 2. degree |
Date: |
Mon, 16 Feb 2009 13:07:03 +0100 |
Dear list,
I just started with Octave and I'd like to check a result compard to R and
excel. The script I'm using in R is:
# Input
n <- 7;
y <- c(0.00,0.17,0.41,1.52,2.83,4.27,7.24);
x <- c(0,17,35,71,107,143,215);
# Polynom 2. degree
polyfit2 <- lm(y~poly(x,2));
# Graphic
plot(y~x,pch=18);
lines(sort(x), polyfit2$fit[order(x)],col='red', lwd=2);
# Summary
summary(polyfit2);
How do I write a polynom (2. degree) in Octave? On the end, I need the
intercept and slope.
Thank you.
Peter
- Polynom, 2. degree,
Peter Stalder <=