필터 지우기
필터 지우기

How can I use cubic spline to smooth data and sketch graphs.

조회 수: 2 (최근 30일)
Vikash Raj
Vikash Raj 2021년 11월 7일
댓글: Vikash Raj 2021년 11월 14일
Hi.
I have large sets of data where I need to use cubic spline to apply smoothing and sketch the graph. In my data I need to find the average of total vertical electron content (VTEC) and come up with one hourly value using cubic spline and than sketch the against time for a period of 24hrs for every month. I'm new to matlab software and any help and suggestions is highly appriciated. Please find attached the set of sample data that i need to analyse for month of Feb. Thank you.
  댓글 수: 2
John D'Errico
John D'Errico 2021년 11월 8일
편집: John D'Errico 2021년 11월 8일
You don't use a cubic spline to average data at a given point. You really want to do that BEFORE you use a cubic spline.
Next, a cubic spline is typically an INTERPOLATING spline, so it won't smooth your data. It will pass directly through the data points.
Finally, you did NOT attach any data. You attached a small PICTURE of your data, which is completely useless unless someone were to try to type in your complete data set. I hope they have very good eyesight if they do. Is there a good reason why you want to make it more difficult for someone to help you?
If you really want help, then it would be best if you actually attach the true data. Do so either by pasting in the data as text, or by attaching a .mat file. A spreadsheet is also acceptable, but it takes slightly more effort for someone to read it in, IF they were going to try to help you. Again, is there a good reason why you want to make it difficult to get timely help? Please edit your question, or attach your data to a comment on your question. (Do not answer your question with the data, as many seem to do.)
Vikash Raj
Vikash Raj 2021년 11월 8일
Appologies for any inconvenience. I have attached the spreadsheet file. Please suggest any suitable method to analyse this data set. Thank you.

댓글을 달려면 로그인하십시오.

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 11월 9일
hello
example of smoothing done on L1 data - FYI -
clc
clearvars
T = readtable('Feb 2020_Elv 50+.csv');
[samples,col] = size(T);
x = (0:samples-1);
L1 = T.L1;
L1s = smoothdata(L1,'movmedian',17);
plot(x,L1,x,L1s)
legend('raw','smoothdata')
  댓글 수: 12
Mathieu NOE
Mathieu NOE 2021년 11월 12일
If you have the Curve fitting toolbox the csaps function (and others) are available
Vikash Raj
Vikash Raj 2021년 11월 14일
Thank you for your suggestions

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Splines에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by