# Help with linear regression

조회 수: 1 (최근 30일)
Teshan Rezel 2022년 2월 3일
댓글: Rik 2022년 2월 4일
Hi folks,
I have 2 tables. A is 256x54 and B is 1x54.
I want to correlate each of the 256 values in each column of table A to the corresponding value in table B, and then find the index within table A that gives the best correlation.
Is this possible? So far I have been unseccessul in applying the \ operator as per the documentation in here: https://uk.mathworks.com/help/matlab/data_analysis/linear-regression.html
Attached are my tables!
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Teshan Rezel 2022년 2월 4일
hi @Rik, I meant, for example, if of the 256 values within A corresponding to the value of B, that the best correlation was found at the 3rd row across all 54 columns, or the 16th etc...then it will return 3 or 16.
Rik 2022년 2월 4일
You want to find the index of the closest number, purely based on the value?
So for the example data below it should return 1 and 3?
A=table([1;2;3],[10;20;30]),B=table(1.4,26)
A = 3×2 table
Var1 Var2 ____ ____ 1 10 2 20 3 30
B = 1×2 table
Var1 Var2 ____ ____ 1.4 26

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

R2021b

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by