Loop data in both x and y direction, and do linear fit of each y at each x
I have two matrice. matrix 1 (time points) is 96 by 1 (row is time); matrix 2 is 96 by 150. matrix 2 is the readout data points (row) at each time point of 150 individual elements (column). I want to fit each data point (matrix 2, row) at each time point (matrix 1) to y=ax+b and so on until the last time point. The result is ideally to be a slope matrix (96 by 150). I have very limited clue on how to do it, appreaciate if anyone know how to do this.I have two matrice. matrix 1 (time points) is 96 by 1 (row is time); matrix 2 is 96 by 150. matrix 2 is the readout data points (row) at each time point of 150 individual elements (column). I want to fit each data point (matrix 2, row) at each time point (matrix 1) to y=ax+b and so on until the last time point. The result is ideally to be a slope matrix (96 by 150). I have very limited clue on how to do it, appreaciate if anyone know how to do this. I have two matrice. matrix 1 (time points) is 96 by 1 (row is time); matrix 2 is 96 by 150. matrix 2 is the readout data points (row) at each time point of 150 individual elements (column). I want to fit each data point (matrix 2, row) at each time point (matrix 1) to y=ax+b and so on until the last time point. The result is ideally to be a slope matrix (96 by 150). I have very limited clue on how to do it, appreaciate if anyone know how to do this. loop, matlab, curve fitting MATLAB Answers — New Questions