Convert minute date (stock data) to matlab from .csv
古いコメントを表示
Dear all,
I've fairly new to MATLAB. Used it in a course Numerical Mathematics but we didn't have to import any data but only using it for calculations.
Well, now I have a vector with the following timedate structure: 26.01.2017 17:45:00.000,
I want this converted to a numerical vector so that I can plot the data and use it in a table or matrix with the rest of the variables (Open, Close, Volume).
I've read and tried to apply datenum and datestr but it didn't led to a succes.
I also have a problem with decimals when I import data and plot these.
I thank you in advance
採用された回答
その他の回答 (2 件)
markusha
2017 年 6 月 25 日
0 投票
datenum('26.01.2017 17:45:00.000','dd.mm.yyyy HH:MM:SS.FFF') works for me.
Peter Perkins
2017 年 6 月 26 日
Try this:
>> d = datetime(2017,06,12,13,31,60*sort(rand(10000,1)),'Format','dd-MM-yyyy HH:mm:ss.SSS');
>> x = randn(size(d));
>> plot(d(100:200),x(100:200))

Actually, there may bnot even be a compelling reason to plot a subset of the data, the plot lets you zoom in and the tick labels adjust their format automatically.
カテゴリ
ヘルプ センター および File Exchange で Calendar についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!