Linear fit for data from 3D matrix

Hello community! I have a 3D matrix like this:
val(:,:,1) =
2.5620 2.0040 1.8380
2.2240 1.9160 1.9030
val(:,:,2) =
2.0330 1.9970 1.8180
2.4040 1.9330 1.9300
val(:,:,3) =
2.4260 2.1040 1.9050
1.9960 1.9630 1.9560
I need to make a linear fit for every group on z axis (here for example, 2.5620, 2.0330, 2.4260). For the fit in 2D plot (just to make it clear, I do not need the plot), the y axis is the same as the z axis of the 3D matrix (suppose simply 1,2 and 3)and x axis is based on the values of the element. After this, I have to get the values on the fit (by y=1,2 and 3) and use the values in 3D matrix minus the values from the fit. Could someone please help me on this? Thank you very much!

댓글 수: 1

Star Strider
Star Strider 2015년 9월 10일
I’m not entirely clear on what you’re asking. Please give an example of what you want to fit, specifying your independent and dependent variables.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

2015년 9월 10일

댓글:

2015년 9월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by