Get the data points after smoothening the plot
1 次查看(过去 30 天)
显示 更早的评论
I have 2 columns and 2388 rows.
I have plotted a graph with input column as y-axis and time as x-axis.
plot(table{3:2388,1}, {3:2388,2});
Then I smoothened the plot and obtained a graph as shown below.
smooth_curve = smoothdata(table{3:2388,2});
plot(table{3:2388,1}, smooth_curve);
How can I get the input(table{3:2388,2}) datapoints after smoothening the graph.
0 个评论
采纳的回答
Star Strider
2022-8-12
I am not certain what you are asking.
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1096630/Untitled%20spreadsheet.xlsx')
% smooth_curve = smoothdata(T1{3:2388,2});
smooth_curve = smoothdata(T1.INPUT);
T1 = addvars(T1,smooth_curve) % Add 'smooth_curve' To 'T1'
VN = T1.Properties.VariableNames;
figure
plot(T1.TIME, T1.INPUT, 'DisplayName',VN{2})
hold on
plot(T1.TIME, T1.smooth_curve, 'DisplayName',strrep(VN{3},'_','\_')) % 'Escape' The Underline So It Prints Correctly In Tne 'legend'
hold off
legend('Location','best')
.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete Data Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!