Change individual data of individual data in MATLAB

Here's a little crazy since I am unable to use the index link for my newly created timers objects.

All I want to do is request / return / change a value from a specific date.

i.e. where my temporary β€œtemp” are daily temperature values ​​and I want to change the value on January 16, 2008. My date structure is formatted as such "01-Jan-2008"

I tried different ways, but did not control !: (

temp('16-Jan-2008')= 25; % Info on this page ref [1] temp(16) = 25; % 16 referring to the element index 

I know that I can enter tstools and change it manually, but I want to do a lot more manipulation with matrices with timers, but somehow I am struggling with a pointer! Could they be easily modified in the command window?

thanks

[1] - http://www.mathworks.co.uk/help/finance/working-with-financial-time-series-objects.html#f13-5213

+4
source share
1 answer

For 2 vectors

time [size = n on 1] and temp [size = n on 1]

If ur timeseries is a char vector (all rows are the same length, not cells). U can be converted to matlab time, e.g.

 time_tmp = datenum(time,'dd-mmm-yyyy'); 

Then u can change the time vector (same length as time)

 temp(time_tmp == datenum(2008,1,16)) = 25; 

otherwise u can convert ur data to 2 vectors and then do above.

0
source

Source: https://habr.com/ru/post/1490498/


All Articles