Trendfitting a series of downsamplings for comparisons
2 views (last 30 days)
Show older comments
Hi all!
I am looking to plot a series of downsamplings and then put an exponential to each to see if the downsampling manipulates data in an unfavorable way. The problem is, when attempting to plot multiple fit lines on one plot to compare the superimposed lines, I cannot control line style, color, nor name them, making a comparison pretty hard to read.
here is a snippet of the code, with an example of the full data, and a downsample of the data.
hold on
f = fit(u_image_time,transpose(median_intensity_pr),'exp2')
h=plot(f);
f1 = fit(downsample(u_image_time,3),transpose(downsample(median_intensity_pr,3)),'exp2')
h=plot(f1);
where this goes on for 5 downsamples with a total of 6 plot lines, not including their respective trendlines.
I was hoping to have a situation where the trend line and standard data would be the same color (or similar) with just different line styles, and have their corresponding titles displayed in a legend.
Below is kind of what I thought I'd do to accomplish it, but they only match up in color because i cannot control the trendline and it is defaulted to red.
f2 = fit(downsample(u_image_time,5),transpose(downsample(median_intensity_pr,5)),'exp2')
h=plot(f2);
h=plot(downsample(u_image_time,5),downsample(median_intensity_pr,5),'r', 'DisplayName', 'Downsample5');
xlim([1.4 30])
legend('location','best')
legend show
hold off
attached are the two .mats that will help this code run.
I appreciate all thoughts! Thanks!
Nick
0 Comments
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing 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!