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!