Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : LSF_Toolbox details
Please login or create an account

LSF_Toolbox

A GUI for one variable Least Square Fitting and Interpolation
(1162 downloads for this version - 2992 downloads for all versions)
Details
Version
0.1.5
Author
MANISH JOSHI
Maintainer
Manish Joshi
Categories
License
Dependency
Creation Date
June 26, 2020
Source created on
Scilab 6.1.x
Binaries available on
Scilab 6.0.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Scilab 6.1.x:
Windows 64-bit Windows 32-bit Linux 64-bit Linux 32-bit MacOSX
Install command
--> atomsInstall("LSF_Toolbox")
Description
            'leastsqr()' It opens a graphical user interface (GUI) for Least Square Fitting
and Interpolation.
you can either enter your data in the table manually or select the data present
in the variable browser.
It currently offers the Least Square curve fitting(Linear, Exponential, Power
Function, and Polynomial),
and Interpolation(Linear, Cubic Spline, Nearest neighbor, and Smooth Spline ).
It will plot the given data and fitted curve and display the corresponding
equation on the result window

******************** SYNTAX ************************

leastsqr()


*****************************************************
*                                                   *
* CHANGELOG of LSF_Toolbox                          *
*                                                   *
***************************************************** 

LSF_Toolbox 0.1.5 / 2020-06-26
  ==============================
  
  - Interpolation feature added
        - Linear.
	- Cubic Spline.
	- Nearest neighbour.
	- Smooth Spline.
  * Bug Fix.
  - Menu icons are now visible.

LSF_Toolbox 0.1.41 / 2020-06-10
  ==============================
  
  * Bug Fix.
  - Error in Exponential and Power Function removed.
  - 0.1.4 version disabled.


LSF_Toolbox 0.1.4 / 2020-06-09
 ==============================
 
 * New design of GUI.
 * Menu added
	- grid on/off.
	- label xlabel/ylabel/title.
	- help menu
 * Results frame added.
	- Now the results will be display on new result farme insted of SCILAB
console.


LSF_Toolbox 0.1.3 / 2020-06-06
==============================
* Now you can add data in the table from the variable browser.
* GUI image added to Help chapter.


LSF_Toolbox 0.1.2 / 2020-06-03
==============================
* Help chapter added.
* SCILAB demo added.


LSF_Toolbox 0.1.1 / 2020-06-01
==============================
Initial release.
            
Files (4)
[159.08 kB]
Miscellaneous file
Screenshot of GUI.
[570.48 kB]
OS-independent binary for Scilab 6.1.x

[570.48 kB]
OS-independent binary for Scilab 6.0.x

[226.13 kB]
Source code archive

News (1)
Comments (1)     Leave a comment 
Comment from Pascal Buehler -- August 6, 2020, 09:58:16 AM    
I have also written a little function for LSQ methods, maybe we can combine them.
function [V,T,H,S]=Trendlinien(Trend,X,Y,P,F)
    n=size(X)
select Trend
    case "poly1" then
        x=[ones(n(1),n(2))',X']
        y=Y'
        V=lsq(x,y)'
        T=V(2)*P+V(1)
        H=prettyprint("y="+string(V(2))+"*x+"+string(V(1)))
    case "poly2" then
        x=[ones(n(1),n(2))',X',X'^2]
        y=Y'
        V=lsq(x,y)'
        T=V(3)*P^2+V(2)*P+V(1)
       
H=prettyprint("y="+string(V(3))+"*x^2+"+string(V(2))+"*x+"+string(V(1)))
    case "poly3" then
        x=[ones(n(1),n(2))',X',X'^2,X'^3]
        y=Y'
        V=lsq(x,y)'
        T=V(4)*P^3+V(3)*P^2+V(2)*P+V(1)
        
H=prettyprint("y="+string(V(4))+"*x^3+"+string(V(3))+"*x^2+"+string(V(2))+"*x+"+strin
g(V(1)))
    case "poly4" then
        x=[ones(n(1),n(2))',X',X'^2,X'^3,X'^4]
        y=Y'
        V=lsq(x,y)'
        T=V(5)*P^4+V(4)*P^3+V(3)*P^2+V(2)*P+V(1)
        
H=prettyprint("y="+string(V(5))+"*x^4+"+string(V(4))+"*x^3+"+string(V(3))+"*x^2+"+str
ing(V(2))+"*x+"+string(V(1)))
    case "poly5" then
        x=[ones(n(1),n(2))',X',X'^2,X'^3,X'^4,X'^5]
        y=Y'
        V=lsq(x,y)'
        T=V(6)*P^5+V(5)*P^4+V(4)*P^3+V(3)*P^2+V(2)*P+V(1)
        
H=prettyprint("y="+string(V(6))+"*x^5+"+string(V(5))+"*x^4+"+string(V(4))+"*x^3+"+str
ing(V(3))+"*x^2+"+string(V(2))+"*x+"+string(V(1)))
    case "poly6" then
        x=[ones(n(1),n(2))',X',X'^2,X'^3,X'^4,X'^5,X'^6]
        y=Y'
        V=lsq(x,y)'
        T=V(7)*P^6+V(6)*P^5+V(5)*P^4+V(4)*P^3+V(3)*P^2+V(2)*P+V(1)
        
H=prettyprint("y="+string(V(7))+"*x^6+"+string(V(6))+"*x^5+"+string(V(5))+"*x^4+"+str
ing(V(4))+"*x^3+"+string(V(3))+"*x^2+"+string(V(2))+"*x+"+string(V(1)))
    case "log" then
        x=[ones(n(1),n(2))',log(X)']
        y=Y'
        V=lsq(x,y)'
        T=V(2)*log(P)+V(1)
        H=prettyprint("y="+string(V(2))+"*log(x)+"+string(V(1)))
    case "exp" then
        x=[ones(n(1),n(2))',X']
        y=log(Y)'
        V=lsq(x,y)'
        T=exp(V(1))*exp(V(2)*P)
       
H=prettyprint("y="+string(exp(V(1)))+"*"+string(exp(V(2)))+"^x")
    case "pot" then
        x=[ones(n(1),n(2))',log(X)']
        y=log(Y)'
        V=lsq(x,y)'
        T=exp(V(1))*P^V(2)
        H=prettyprint("y="+string(exp(V(1)))+"*x^"+string(V(2)))
   case "sin" then
        x=[ones(n(1),n(2))',sin(2*%pi*F*X)']
        y=Y'
        V=lsq(x,y)'
        T=V(1)+V(2)*sin(2*%pi*F*P)
       
H=prettyprint("y="+string(V(1))+"+"+string(V(2))+"*sin(2*pi*f*x)")
   case "cos" then
        x=[ones(n(1),n(2))',cos(2*%pi*F*X)']
        y=Y'
        V=lsq(x,y)'
        T=V(1)+V(2)*cos(2*%pi*F*P)
       
H=prettyprint("y="+string(V(1))+"+"+string(V(2))+"*cos(2*pi*f*x)")
   case "tan" then
        x=[ones(n(1),n(2))',tan(2*%pi*F*X)']
        y=Y'
        V=lsq(x,y)'
        T=V(1)+V(2)*tan(2*%pi*F*P)
       
H=prettyprint("y="+string(V(1))+"+"+string(V(2))+"*tan(2*pi*f*x)")
   case "PT1E" then
        K=strange(Y)
        x=[ones(n(1),n(2))',X']
        y=log(Y./K)'
        V=lsq(x,y)'
        T=[K*exp(V(1))*exp(V(2)*P)]
       
H=[prettyprint("y="+string(abs(V(1)*K))+"*e^(t/"+string(V(2))+")")]
        p0y=Y(1)
        p0x=X(1)
        p1y=[1-0.632]*K
        p1x=X(find(Y<=p1y)(1))
        p2y=Y($)
        p2x=p0x+((p2y-K)/((p1y-p0y)/(p1x-p0x)))
        S=[p0x,p1x,p2x;p0y,p1y,p2y]
   case "PT1L" then//Test
        K=strange(Y)
        x=[ones(n(1),n(2))',X']
        y=log(1./K)-log(Y./K)'
        V=lsq(x,y)'
        T=[(K-0.632)*exp(V(1))*((K-0.632)-exp(V(2)*P))]//stimmt noch nicht
       
H=[prettyprint("y="+string(abs(V(1)*K))+"*(1-e^(t/"+string(V(2))+"))")]
        p0y=Y(1)
        p0x=X(1)
        p1y=[0.632]*K
        p1x=X(find(Y<=p1y)(1))
        p2y=Y($)
        p2x=p0x+((p2y-K)/((p1y-p0y)/(p1x-p0x)))
        S=[p0x,p1x,p2x;p0y,p1y,p2y]
        //case "PTN" then
        //2 Ableitung gleich null wendepunkt
    else disp("False Input")
        end
endfunction

Answer from Manish Joshi -- August 6, 2020, 11:12:26 AM    
This answer has been deleted.
Answer from Manish Joshi -- August 6, 2020, 11:15:10 AM    
sure, you can write an email to me, and attach the following:
(1) code(please comment the code so that i can understand it clearly.)
(2) Description.
(3) Any other suggestion about toolbox or about your code.
email - manishcjoshi23@gmail.com

Thank you.
Leave a comment
You must register and log in before leaving a comment.
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.