Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages<12
Options
Go to last post Go to first unread
Offline MarB  
#21 Posted : 11 December 2019 19:31:21(UTC)
MarB


Rank: Advanced Member

Groups: Registered
Joined: 21/10/2016(UTC)
Posts: 84

Was thanked: 21 time(s) in 17 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post


Hope this document will tranquilize visitors/users !

Jean.




If that's what you think.
Offline Jean Giraud  
#22 Posted : 12 December 2019 01:05:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: MarB Go to Quoted Post
If that's what you think.

Does it work for you ... SS 7251 users please confirm ?


Offline CBG  
#23 Posted : 12 December 2019 03:25:41(UTC)
CBG


Rank: Advanced Member

Groups: Registered
Joined: 14/10/2015(UTC)
Posts: 308

Was thanked: 77 time(s) in 58 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: MarB Go to Quoted Post
If that's what you think.

Does it work for you ... SS 7251 users please confirm ?




Hello Jean

Yes, It works


Carlos
Offline ndtma  
#24 Posted : 12 December 2019 06:09:00(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally 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
Offline ndtma  
#25 Posted : 12 December 2019 13:41:20(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Originally Posted by: MarB Go to Quoted Post
That'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.

PolyFit_MB.png

Edited by user 12 December 2019 13:47:51(UTC)  | Reason: Not specified

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline MarB  
#26 Posted : 12 December 2019 13:53:51(UTC)
MarB


Rank: Advanced Member

Groups: Registered
Joined: 21/10/2016(UTC)
Posts: 84

Was thanked: 21 time(s) in 17 post(s)
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.)

Originally Posted by: MarB Go to Quoted Post

polyfit.png


Originally Posted by: ndtma Go to Quoted Post
Originally Posted by: MarB Go to Quoted Post
That'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.


Offline ndtma  
#27 Posted : 12 December 2019 16:21:08(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Originally Posted by: MarB Go to Quoted Post
just 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.

Edited by user 12 December 2019 16:25:22(UTC)  | Reason: Not specified

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline MarB  
#28 Posted : 12 December 2019 17:21:42(UTC)
MarB


Rank: Advanced Member

Groups: Registered
Joined: 21/10/2016(UTC)
Posts: 84

Was thanked: 21 time(s) in 17 post(s)
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 (12kb) downloaded 17 time(s).


I would expect the results of g and h to be the same, and to be a 3 items long vector.


vectorize.jpg
thanks 1 user thanked MarB for this useful post.
on 12/12/2019(UTC)
Offline ndtma  
#29 Posted : 12 December 2019 17:49:54(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
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.

Edited by user 12 December 2019 17:55:26(UTC)  | Reason: Additional checks

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Jean Giraud  
#30 Posted : 12 December 2019 19:06:39(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
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 (47kb) downloaded 17 time(s).
Offline Razonar  
#31 Posted : 12 December 2019 21:12:19(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,357
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: ndtma Go to Quoted Post

...
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.

Clipboard01.gif

PolyFit.sm (160kb) downloaded 26 time(s).
PolyFit.pdf (749kb) downloaded 19 time(s).

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 12/12/2019(UTC)
Offline ndtma  
#32 Posted : 12 December 2019 21:15:52(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Thank you, Alvaro.
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Users browsing this topic
Guest
2 Pages<12
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.