Split vector in groups of data and plot best fit
Show older comments
Good evening,
I have a group of data in the following format:
Dat = [ NaN ; NaN ; 23 ; 34 ; 5 ; 12 ; 4 ; 123 ; NaN ; NaN ; Nan ; 23 ; 4 ; 1 ; 4 ; 21 ; Nan ; 234 ; 12 ; 3 ; 12 ; NaN ; 342 ; 32 ; NaN ; NaN ; NaN ; NaN ; 34 ] ;
I would like to take the groups of values between the NaN sets and plot best fit equation. So I would take:
a = [23 34 5 12 4 123 ] b= [23 4 1 4 21] c= etc....
and plot a best fit curve for each of these.
I have managed to come up with a way using indices and a for loop, but it is way to complicated. Also this results to some bugs coming up as we saw with my teacher. So is there any way you would suggest?
KR,
Kosta
1 Comment
Konstantinos Tsitsilonis
on 23 Jun 2017
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!