# Matlab: How to generate the time data

1. Jun 30, 2011

### hsydxhza

Hey everyone,
I'm a new starter of matlab, and I'm asked to generate the time data , for a data set of 2 days worth of normalised data with 96 data points total (48 per day)
0.605377319
0.592191368
0.583245509
0.575892748
0.576088821
0.57089287
0.556358913
0.560623514
0.579936766
0.650817382
0.723291096
0.818533859
0.881596039
0.925761623
0.933040857
0.958407882
0.967745889
0.975466288
0.978627975
0.976912331
Here are a part of data I got, and they represent a normalised load of the UK, i.e. divided all the power values by the peak value to get a number between 0 and 1.
Can anyone here help me with it?

Cheers
Clark

2. Jul 1, 2011

### MATLABdude

Welcome to PhysicsForums!

What do you mean by time data? Just elapsed seconds / minutes?

You'll need to generate a vector of values. If you want equal spacing, MATLAB allows you to conveniently generate these using the colon (:) operator. The following code generates a vector (list) of numbers from 0 to 24 (in increments of 1, the middle number):
>> hourVector = 0:1:24;

Mathworks provides quite extensive documentation on MATLAB at their website (as linked below in my signature). They also provide quite a nice set of tutorials if you're brand new to MATLAB (I don't know how the videos work, but the young ones seem quite fond of them these days, as opposed to the written tutorials which I learned on):
http://www.mathworks.com/help/techdoc/learn_matlab/bqr_2pl.html

Good luck!