Linear fit for data from 3D matrix

8 次查看(过去 30 天)
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 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by