MATLAB: Subtracting and saving in an array

My data looks like this, where column headers are No and Time,respectively.
'1' '0.000000000'
'2' '0.100244000'
'3' '0.199460000'
'4' '0.299659000'
'5' '0.399856000'
'6' '0.499070000'
.
.
'50' '4.893317000'
'51' '4.993553000'
'53' '5.095700000'
'55' '5.194844000'
'57' '5.295069000'
How to find:
  1. I want to find the values for (0.000000000 – 0.100244000), (0.100244000 – 0.199460000) and write the answers in a separate array.(eg:No, Time, and Time difference).
  2. In the 1st column,after value 51, next value is 53. I want to count how many values have been jumped like that instead of following a sequence as 51,52,53…

Best Answer

Based on the text file that you uploaded, I altered my first answer to read all of the columns in your data:
fid = fopen('temp.txt', 'r');
data = textscan(fid, '%d%f%s%s%s%d%s', 'MultipleDelimsAsOne',true, 'HeaderLines',1);
fclose(fid);
jumps = sum(abs(diff(data{1})>1));
timeD = diff(data{2});
After placing this in a script and running it, I can confirm that it correctly extracts the data from your sample data file:
>> jumps
jumps =
1
>> data{1}
ans =
1
2
3
4
5
7
8
9
10
11
12
13
14
15
Note that I altered your text file by removing data row six to provide a jump in the first column, which it seems you want to detect, otherwise it is identical to what you uploaded earlier.