So; I'm creating a program called regression(n) which will do Linear Regression on a set of n sets of user inputted x and y values.
I wish them to be asked for n sets of x,y values, one-by-one that'll be assigned to two lists L1 and L2 and input as x1, y1, x2, y2, etc.
So far I have this:
if n<1 then
Text "Number too small"
"Enter X" & string(z)->Str1
Input Str1, i1
"Enter Y" & string(z)->Str1
Input Str1, i2
Text string(l1(z)) & ", " & string(l2(z))
Text "Use y1(x) to Enter New X Values"
Pretend that (c) is the copyright symbol. I don't know how to enter code on this forum properly. When I typed colons, it just got rid of all the lines except the first and last lines.
Anyways, it is not doing as I expect it should, and I'm sure it is related to my weak understanding of Arrays and Lists.
First, ClrHome is not clearing the HOME page, as I would guess it would.
Next, I am trying to create two lists, L1 and L2, that have n number of X and Y values in them (X values in L1, Y in L2)
I tried setting:
Because it says it redims it to what you put into the Dim command… also tried hardwiring it as:
which also didn't work.
So, I guess both L1 and L2 would have a length of 999, then.
Next, I'm trying to use the Input function to input the X and Y values into L1(z), L2(z) … but it isn't working right:
I originally tried:
Input Str1, L1(z)
Which is what I would think I should be able to do. But that didn't work; so, that is why I am trying to assign it to i1, then to L1(z)
It at least doesn't give me an error that way… however, it only SEEMS like it's working. In the end I get the unexpected values where L1(1) = the last thing I entered, not the first and L2(1) is the same way???
And, when I try to use the two lists L1,L2 at the LinReg line, it gives me a 'Data Type' error.
Where are my many errors (including - how does one put code into this forum without it disappearing)???