Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to calculate the linear regression of each cell of z value of array data?

조회 수: 1 (최근 30일)
Shakir Hussain
Shakir Hussain 2019년 3월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
How can calculate the linear regression/trend for z value of array
for example 10*16*108 and I want to apply regression formula only on z value (108) which will give the output matrix 10*16 showing unique trend of each cell of data.
I have no idea to get required output.
  댓글 수: 4
dpb
dpb 2019년 3월 14일
I have no idea what that means???
What do you want to fit to what?
I gather the content of the 3D array is the response variable, but what is the independent?
dpb
dpb 2019년 3월 14일
>> load subset
>> whos subset
Name Size Bytes Class Attributes
subset 817x941x23 17682331 uint8
>> subset(1:10,1:10,1:3)
10×10×3 uint8 array
ans(:,:,1) =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ans(:,:,2) =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ans(:,:,3) =
100 0 0 0 0 0 0 36 85 0
100 0 0 0 0 0 0 9 97 0
100 0 0 0 0 0 0 17 24 0
100 100 0 0 0 0 0 6 88 0
100 100 0 0 0 0 0 17 100 0
100 98 0 0 0 0 0 8 0 0
100 100 0 0 0 0 0 16 0 22
100 96 0 0 0 0 0 15 0 47
100 94 0 0 0 0 0 34 0 10
0 100 0 0 0 0 0 57 0 16
>> subset(1:10,1:10,end-4:end)
10×10×5 uint8 array
ans(:,:,1) =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
ans(:,:,2) =
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
0 0 0 100 0 0 0 0 0 0
ans(:,:,3) =
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
100 100 100 100 100 100 100 100 100 0
ans(:,:,4) =
0 0 100 0 0 100 100 100 100 100
0 0 100 0 0 100 100 100 100 100
0 0 100 0 0 100 100 100 100 100
0 0 100 0 0 100 100 100 100 100
0 0 100 0 0 100 100 100 100 100
0 100 100 0 0 100 100 100 100 100
0 100 100 0 0 100 100 100 100 100
0 100 100 0 0 100 100 100 100 100
0 100 100 0 0 100 100 100 100 100
0 100 100 0 0 100 100 100 100 100
ans(:,:,5) =
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
100 100 100 100 100 100 100 100 100 100
>>
I see nothing theere about 10*16*108 and absolutely nothing that looks like would be a suitable indepenent variable for fitting against, nor does there seem to be any trend in the data in the array itself that makes any sense to put a trend line through.
Show us a SMALL example of what yuo think your data is and what you want to do with it.

답변 (0개)

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by