# Lable x axis's and advance way of cubic spline methods. ?

2 vues (au cours des 30 derniers jours)
Vikash Raj le 20 Jan 2022
Modifié(e) : Matt J le 20 Jan 2022
Hi,
I'm studying about total electron content using matlab programing. I need to plot the best graph of Time Vs VTEC.
I have downloaded the vertical total electron content from swarm mission measured by swarm satellites. The timestamp format of my data is as "2016-02-01T00:19:09Z" while the to VTEC is a simple vector in numerical form. When I import the timestamp data from the MS excel sheet it reads in cellarray format in matlab while the VTec data is in the Numerical matrix format. The time is unevenly distributed and I need sketch the of one whole month.
I'm attaching my spline codes.
%% Remove T and Z and time in HH:mm:ss form timestamp
TM1 = strrep(Timestamp, 'T', ' ');
TM2 = strrep(TM1, 'Z', ' ');
TmF = datetime(TM2, 'InputFormat','yyyy-MM-dd HH:mm:ss', 'Format','HH:mm:ss');
%% Apply Cubic Spline
p = 0.00000009;
sp = csaps(datenum(TmF), Absolute_VTEC, p);
fnplt(sp, '--b');
%% Attemp to lable axis in hrs But not working
set(gca, 'XTick', [1:2:24], 'XTickLabel', rem([1:2:24]+0,24))
axis([1 24 1 33])
xlabel('Time (Hr)')
Q1. Im able to apply the cubic spline but is there any advance or better way to improve my graph since im not getting the graph as expected?
Q2. When I'm trying to lable the axis with hrs from 0 to 24 then the graph disappears. How can I fix this issue ?
I'm new to matlab programing and seek your kind assistance if you could guide me in the matlab codes.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Splines dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by