Matlab differential smoothing slider for multiple lines in plot
1 view (last 30 days)
Show older comments
Hi I am wondering if someone could help me with this problem...
I have made a GUI to import and plot multiple file, here is the code:
d= uigetdir(pwd, 'Select a folder');
files = dir(fullfile(d, '*.txt'));
len = length(files);
linecolors = jet(len);
for i = 1:len
a = files(i).name;
filename{i} = a;
path = [d,'\',a];
data = dlmread(path);
plot(data(:,1), data(:,2),'color',linecolors(i,:),'linewidth',2);
hold on;
end
hold off;
I would now like to smooth the lines, but how do I go about smoothing multiple lines in a plot?
The smoothing method I would like to use is where the differential between two points is found and that gradient is plotted. Is there a built in matlab function for this?
I would also like to vary the amount of smoothing i.e. finding the differential 1/2/3 etc.. times over. Would I be able to make a slider for this? Or else allow the user to enter in a number for the number of times they want the differential to be taken?
If you don't know specifically how I can go about coding this, I would still be grateful if you could point me in the right direction :)
0 Comments
Answers (0)
See Also
Categories
Find more on Smoothing 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!