I am having a problem using corelation with table variables.

조회 수: 3 (최근 30일)
ÖMER
ÖMER 2023년 11월 5일
댓글: ÖMER 2023년 11월 5일
Hello all;
I am trying to find the corelation between two table variables. To be specific not the corelation between values in the tables, directly corelation between two tables.
Both of the table variables have the same number of rows (618364x1).
So far I have tried ;
M(k,p) = corr(data_array1,data_array2)
result;
Error using ()
Subscripting into a table using one subscript (as in t(i)) is not supported.
Specify a row subscript and a variable subscript, as in t(rows,vars). To
select variables, use t(:,i) or for one variable t.(i). To select rows, use
t(i,:).
M(k,p) = corr(data_array1(:,1),data_array2(:,1))
result;
Error using ()
Subscripting into a table using one subscript (as in t(i)) is not supported.
Specify a row subscript and a variable subscript, as in t(rows,vars). To
select variables, use t(:,i) or for one variable t.(i). To select rows, use
t(i,:).
Unfortunately I have tried nearly everthing that I know and search for. Still getting the same error.

채택된 답변

KSSV
KSSV 2023년 11월 5일
편집: KSSV 2023년 11월 5일
M(k,p) = corr(data_array1.(1),data_array2.(1))
OR
M(k,p) = corr(table2array(data_array1),table2array(data_array2))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by