New Reply

MATLAB HELP how to ask user for 2 input variables

 
Share Thread Thread Tools
Jun14-12, 01:04 PM   #1
 

MATLAB HELP how to ask user for 2 input variables


I have an assignment where we have to ask the user for a number of data points which then we will graph a linear regression.


Enter the number of input data points: 7
Enter [x y] pair for point 1: [1.1 1.01]
Enter [x y] pair for point 2: [2.2 2.30]
Enter [x y] pair for point 3: [3.3 3.05]
Enter [x y] pair for point 4: [4.4 4.28]
Enter [x y] pair for point 5: [5.5 5.75]
Enter [x y] pair for point 6: [6.6 6.48]
Enter [x y] pair for point 7: [7.7 7.84]


This is what the program should look like as we are asking the user for the inputs. (The brackets are what the user inputs). How should the code look to get 2 separate variables? Any help would be greatly appreciated!
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> 'Whodunnit' of Irish potato famine solved
>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change
>> Curiosity Mars rover drills second rock target
New Reply

Tags
inputs, linear regression, matlab, user input
Thread Tools


Similar Threads for: MATLAB HELP how to ask user for 2 input variables
Thread Forum Replies
CSE 1010 - MATLAB - User-Controlled Input and Output - fprintf Engineering, Comp Sci, & Technology Homework 0
How to set a variable name by user input in MATLAB Math & Science Software 5
how to get an input matrix from user??? Linear & Abstract Algebra 1
input 4m user: MATLAB Programming & Comp Sci 0
matlab user input variable name Math & Science Software 1