How to create a time serie with daily data
Ältere Kommentare anzeigen
Please i am trying to make a time series with daily financial datas.
The datas are observed daily except on weekends.
My main concern is that i am trying to set a moving starting (02 of january 2017) date with the function dattetime but i am having an error message. Please could you tell me what i did wrong?
M

Also , can you tell me how i can account for the weekly two days break in the time series.

Regards
1 Kommentar
Sandeep Mishra
am 17 Jan. 2025
Hi @Job1003
Can you also attach the missing variable/function 'txt' and 'ts' for better debugging?
Akzeptierte Antwort
Weitere Antworten (1)
Hi Job1003,
I noticed that you are encountering an error message related to the use of the 'strrep' function in MATLAB
The root cause of the issue arises from passing an incorrect input for the 'str' parameter in the 'strrep' MATLAB function, which must be a character array.
You can refer to the following example code snippet using ‘strrep’ MATLAB function:
% Correct input - Willn't thorw any error
data = {'123', 'hello', '456', 'world'};
strrep(data, 'o', 'a')
% Wrong input - Will throw the same error
data = {123, 'hello', 456, 'world'};
strrep(data, 'o', 'a')
Refer to the following MATLAB Documentation to learn more about ‘strrep’ function: https://www.mathworks.com/help/releases/R2024b/matlab/ref/strrep.html
I hope this helps you!
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!