lsqgame

# lsqgame - %LSQGAME Least Squares Line Game last updated An...

This preview shows pages 1–3. Sign up to view the full content.

%LSQGAME Least Squares Line Game last updated 2/10/96 % % An interactive 'game' to select the least squares line % to a set of data. Two guesses for the lsq line can be made % using the mouse to select two points that are then connected. % The 'true' least squares line can be displayed. % The sum of the squares of the vertical deviations from the % corresponding line is computed and displayed. % % The data set for the 'game' can be entered using the mouse, % typed in as a n by 2 matrix, loaded from a previously % stored data set, or loaded by executing a m-file. In the % latter two cases the data set must be an n by 2 matrix % specifically named dmat. % % Upon quitting the game the data set dmat can be saved for % future use. % % Use in the form ===> lsqgame <=== % % By: David R. Hill, Math Dept, Temple University, % Philadelphia, Pa. 19122 Email: [email protected] [email protected]+++++++ %locations of deviation messages % locsum1=[-.16 .60;-.16 .55;-.16 .50;-.16 .45;-.16 .40;-.16 .35]; %INITIALIZING Switches % swq='N'; %if data set done sw1='N'; %if line #1 done sw2='N'; %if line #2 done dev2sw='N'; %deviations for line #2 dev1sw='N'; %NUMBER of players is 1 or 2 playnum = 1; %default %STRINGS % mess1='Selection out of range.'; mess2=' '; mess3='Vertical line; make another choice.'; mess4='Sum of Squares of Deviations is '; header='LSQ LINE GAME'; beep=setstr(7); s0=' '; s1=' LSQ LINE GAME'; s2='DATA ENTRY'; s3='LSQGAME is over!'; s4='Data Entry as a set of ordered pairs in an n by 2 matrix'; s5='Enter your matrix like [ 2,3;4,-8; . ... ] where the x and y'; s6='coordinates are seperated by a comma and the data pairs are'; s7='seperated by a semicolon. Do not forget the square brackets.'; s8='Data Matrix = ';

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
s9=['Data Entry from stored data file.'; 'The matrix must be called dmat. ']; s10=['Enter file name with '; 'appropriate path and attribute: ==> ']; s11='Data Entry from an m-file. '; s12=['The matrix containing the'; 'data must be called dmat.']; s13=['Enter m-file name '; 'with appropriate path: ==> ']; s14='Matrix of data must be n by 2'; dmenu=[' 1. Select data using the mouse. '; ' '; ' 2. Enter n data points as an n by 2 matrix or '; ' type the name of an n by 2 matrix of data. '; ' '; ' 3. Use an n by 2 matrix of data stored in a file.'; ' '; ' 4. Execute an m-file that creates a data set. '; ' '; ' 0. QUIT. ']; makech='Enter your choice ==> '; cont='Press ENTER to continue.'; mousedat=[' Directions for Selecting Data Using the Mouse '; ' '; 'In the graphics box to be shown, position the mouse at a '; 'point and click the mouse to record the coordinates of the'; 'point as data. Continue using the mouse to complete your '; 'set of data. The data points will be designated by an * . '; ' '; 'To indicate that you have completed data selection press q'; 'on the keyboard. '; ' '; 'Stay within the graphics box for data selection. ']; %Player INFO player=['This is an interactive game to select a least squares line model';
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/26/2012 for the course MA 261 taught by Professor Stefanov during the Spring '08 term at Purdue.

### Page1 / 9

lsqgame - %LSQGAME Least Squares Line Game last updated An...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online