--%>

Problem on Vectors

Create a vector representing x coordinates of a measurement with 20 points between 0 and 10. Create another vector y representing fake measurements which are related to the above x values as y = 2.3 x – 1.2. Next add random (normal, Gaussian) noise to the vector y. Plot on the same graph both versions of vector y in different colors. Next use attached linregr.m function to find a least square fit (linear regression) for your fake experimental data.

E

Expert

Verified

Calculations:

x=0:0.5:10;

y = 2.3*x - 1.2;

x1=x.^2;

xvar=mean(x1)-((mean(x)).^2);

xstd=sqrt(xvar);

noise= 1/(sqrt(2*pi*xstd))*exp(-((x-mean(x)).^2)/(2*xvar));

y1=y+noise

plot(x,y,x,y1,'g');

legend('Normal Y vector','Noise additive Y vector');

XLABEL('x')

YLABEL('Normal Y vector=2.3*x-1.2')

[a, r2]= linregr(x,y);


Results:

502_2013a.jpg


Least square fit Results gives the Least regression for the fake experimental results a = vector of slope, a(1)- → 2.3, and intercept a(2)-→ -1.2
r2 = coefficient of determination = 1

 

2061_2013b.jpg

   Related Questions in Programming Languages

  • Q : Explain Abstract Windowing Toolkit

    Abstract Windowing Toolkit: The Abstract Windowing Toolkit (AWT) offers a collection of classes which simplify the creation of applications with the GUI (graphical user interfaces). Such are to be found in the java.awt packages. Included are classes f

  • Q : Define Homology Modeling In Structural

    Homology Modelling is a process in which models are generated. The generated models may be conceptual or graphical or/and mathematical.So, we have different methods, tools and techniques for all kinds of modeling.Modelling methods are broadly classifi

  • Q : Aggregation and containment in the

    Illustrate the basic difference between Aggregation and containment in the Programming?

  • Q : Explain Variable declaration Variable

    Variable declaration: It is the association of a variable with a specific type. It is significant to make a distinction among the declaration of variables of primitive types and such of class types. The variable of primitive type performs as a contain

  • Q : Application of S60 device The

    The application has been earlier tested along with an S60 2nd Edition device and this is Symbian Signed. So can I install similar application to another S60 device?

  • Q : BAT files and shell scripts Using the

    Using the Web as a resource for your investigation, find out and explain what BAT files and shell scripts contain, and what they are used for. In the light of your findings, discuss why an operating system would provide both a graphical user interface

  • Q : How Does Run time data handled into QTP

    How Does Run time data i.e. Parameterization is handled within QTP?

  • Q : State the term WSDL State the term WSDL

    State the term WSDL?

  • Q : Distinct features of Object oriented

    Q. What are the distinct features of Object oriented programming language?  

    Q : Technologies are used in AJAX Name the

    Name the technologies that are used in AJAX?