Data alignment in Excel or Matlab? -
i carried out experiment , automatically got readings in .csv file format.
apparatus supposed take reading every 0.1 seconds, , offline.
apparatus kept counting didn't print these in csv file.
example, go reading 98.5, 98.6, 99.0.
i'm looking way put blank rows in there missing data, such it'll read 98.5, 98.6, 98.7, 98.8, 98.9, 99.0. , give values of nan these.
doing individually isn't option, there vast amount of data (864,00 day).
ideas on doing in excel or matlab?
in matlab:
it looks data has 1 decimal digit. in order avoid floating point errors, can multiply first column 10 , round it, create indices. (an alternative use ismemberf
fileexchange).
now, create matrix of nan
s of desired size. after that, fill elements corresponding indices found.
idx = round(a(:,1)*10); x = nan(max(idx)-min(idx),2); x(idx+1,:) = = 0 0.8147 0.1000 0.9058 0.5000 0.0975 0.6000 0.2785 0.7000 0.5469 0.8000 0.9575 1.1000 0.9649 1.2000 0.1576 1.3000 0.9706 1.4000 0.9572 x = 0 0.8147 0.1000 0.9058 nan nan nan nan nan nan 0.5000 0.0975 0.6000 0.2785 0.7000 0.5469 0.8000 0.9575 nan nan nan nan 1.1000 0.9649 1.2000 0.1576 1.3000 0.9706 1.4000 0.9572
in excel:
you can use vlookup
. if doesn't find value, return n/a
. function used in screenshot below is:
=vlookup(d1;$a$1:$b$10;2;0)
Comments
Post a Comment