Program for Linear and Polynomial Fit - Mensajes
Wrote
Hope this document will tranquilize visitors/users !
Jean.
If that's what you think.
WroteIf that's what you think.
Does it work for you ... SS 7251 users please confirm ?
WroteWroteIf that's what you think.
Does it work for you ... SS 7251 users please confirm ?
Hello Jean
Yes, It works
Carlos
WroteOriginally Posted by: MarB [url=/forum/yaf_postsm60156_Program-for-Linear-and-Polynomial-Fit.aspx#post60156][/url]If that's what you think.
Does it work for you ... SS 7251 users please confirm ?
It works. Thank you MarB.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
WroteThat's my solution
- to separate the functions from matrix building,
- to use vectorize for speed
Apparently, the function f(#x):=1 if n=0 has a problem?. Or is it redundant?
For values n>0, the "otherwise" condition yields correct results irrespective of values in "if" condition.
Please check.

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Hi,
just put the 1 into a 1x1 matrix. That's all.
(And if you want to use units with the X Vector, just remove the eval and evaluate symbolically.)
just put the 1 into a 1x1 matrix. That's all.
(And if you want to use units with the X Vector, just remove the eval and evaluate symbolically.)
Wrote
WroteWroteThat's my solution
- to separate the functions from matrix building,
- to use vectorize for speed
Apparently, the function f(#x):=1 if n=0 has a problem?. Or is it redundant?
For values n>0, the "otherwise" condition yields correct results irrespective of values in "if" condition.
Please check.
Wrotejust put the 1 into a 1x1 matrix. That's all.
Hi
Still the same error when n=0.
Better if you can post the SM file please.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Sorry, I didn't realize, that vectorize behaves unexpectedly (to me), when the function does not include 'x'.
So I changed f to f(x):=[1+0*x] and now it works. The file is attached.
PolyFit.sm (11,92 KiB) descargado 1268 vez(es).
I would expect the results of g and h to be the same, and to be a 3 items long vector.

So I changed f to f(x):=[1+0*x] and now it works. The file is attached.
PolyFit.sm (11,92 KiB) descargado 1268 vez(es).
I would expect the results of g and h to be the same, and to be a 3 items long vector.

A 1 usuarios les gustó este mensaje
sergio 12/12/2019 16:13:00
Hi
Now I get same results as yours.
But the result (19.0833) of the Polyfit() function when n=0 ----> Does it have any meaning?
I have no idea. I was only testing it for all possible conditions..
Cheers MarB.
Note: Incidentally, 19.0833 happens to be the Mean of Y vector.
Now I get same results as yours.
But the result (19.0833) of the Polyfit() function when n=0 ----> Does it have any meaning?
I have no idea. I was only testing it for all possible conditions..
Cheers MarB.
Note: Incidentally, 19.0833 happens to be the Mean of Y vector.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
IMHO ... no need to complicate matters.
Modular design is easier to fix.
More automated is OK if you intend to poly for the entire Planet.
PolyFit (2).sm (46,79 KiB) descargado 1292 vez(es).
Modular design is easier to fix.
More automated is OK if you intend to poly for the entire Planet.
PolyFit (2).sm (46,79 KiB) descargado 1292 vez(es).
Wrote
...
But the result (19.0833) of the Polyfit() function when n=0 ----> Does it have any meaning?
I have no idea. I was only testing it for all possible conditions..
...
Hi. This is in case you want to interpolate with an horizontal line.

PolyFit.sm (159,33 KiB) descargado 1313 vez(es).
PolyFit.pdf (748,27 KiB) descargado 815 vez(es).
Best regards.
Alvaro.
A 1 usuarios les gustó este mensaje
sergio 12/12/2019 16:12:00
Thank you, Alvaro.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
- Nuevos mensajes
- Sin mensajes nuevos
