Filling a repeating series
Show older comments
I am writing a script to deal with data output from a machine, I've attached a sample set. For columns A and B, the first column has 1-3 repeated and the second has the values measured. The data is effectively groups of three but with many data sets in the same column. (For example 2.03E+07, 7.41E+06, 1.51E+06 are the first set of three, 325000, 103000, 20300 are an independent set of three, etc. and the order matters. I hope that makes sense.)
My issue is that in some cases the value of 2 for example might be zero and the native software doesn't enter it as zero is just doesn't input it at all (like in columns E and F).
Is there a way to essentially say to Matlab that the first column should be 1-3 repeated so if one of the numbers is missing to input it in the first column and insert a zero in the second column? Effectively transformin columns E and F to I and J.
Sorry this is written in such a convoluted manner, I'm struggling to explain it well. Any other suggestions for getting around this problem are also welcome. Thanks
2 Comments
This is the contents of the Excel file - much easier to post it as text than to let the readers download and open it in Excel:
1 2.03E+07 1 2.03E+07
2 7.41E+06 3 1.51E+06
3 1.51E+06 2 103000
1 325000 3 20300
2 103000 1 196000
3 20300 2 57400
1 196000 3 15500
2 57400 1 211000
3 15500 2 60200
1 211000 3 14400
2 60200 1 172000
3 14400 2 56000
1 172000 3 13800
2 56000
3 13800
Now please explain, what "in some cases the value of 2 for example might be zero" means. Does the question concern the Excel file, so do you want to update the file? Or did you import the data already and the detail, that they come from an Excel file is not relevant?
Richard
on 22 Oct 2018
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!