Linear fit for data from 3D matrix

4 views (last 30 days)
James Lorringer
James Lorringer on 10 Sep 2015
Commented: Star Strider on 10 Sep 2015
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 Comment
Star Strider
Star Strider on 10 Sep 2015
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!