Linear Fitting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have a 512*256 data file. What I want to be able to do is create a new matrix by doing the following

First, I want to calculate the linear fit equation for each row (the equation is different for each row). Then, I want to replace every value in that row with the value stored there minus the linear fit equation, where x is just the index number for the row. I want to be able to do this for all 512 rows, ultimately creating a whole new data set

Let me just provide you with an example so it's clear what I am asking. So in my data file there are 256 numbers in the first row. That first row has some associated linear fit equation. I want to replace all these 256 numbers with the old values minus the linear fit equation. So if a value is 10 (it's in the first row, x=1) and the linear equation is 5-x, my new value to replace 10 would be 10-(5-1) = 10-4 = 6. Then we would just want to repeat this for every row, and every cell in each row.

I would really appreciate any help on any part or all of this. Thank you very much for your help, I really appreciate it!!! If I'm not being clear just let me know. Thanks agai

Wy-Men Loh
 
Wy-Men
Are you saying that each row has a linear equation, say
y = f(x) where x is the column number and y is the number derived from the
linear fit equation? Then each cell would be changed to (old value)-y? If
so, you would need a looping macro which is fairly simple to code.
Where are the linear equations for each row? In a list somewhere, by
row number perhaps? Post back with more details or contact me direct at
(e-mail address removed)
Remove "cobia97" from this address. HTH Otto
Wy-Men said:
Hello,

I have a 512*256 data file. What I want to be able to do is create a new matrix by doing the following:

First, I want to calculate the linear fit equation for each row (the
equation is different for each row). Then, I want to replace every value in
that row with the value stored there minus the linear fit equation, where x
is just the index number for the row. I want to be able to do this for all
512 rows, ultimately creating a whole new data set.
Let me just provide you with an example so it's clear what I am asking.
So in my data file there are 256 numbers in the first row. That first row
has some associated linear fit equation. I want to replace all these 256
numbers with the old values minus the linear fit equation. So if a value is
10 (it's in the first row, x=1) and the linear equation is 5-x, my new value
to replace 10 would be 10-(5-1) = 10-4 = 6. Then we would just want to
repeat this for every row, and every cell in each row.
I would really appreciate any help on any part or all of this. Thank you
very much for your help, I really appreciate it!!! If I'm not being clear
just let me know. Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top