MATLAB: Can MATLAB increment multiple rows of array data

incrementMATLAB

Can MATLAB increment multiple rows of array data?
Guys, got an interesting problem pertaining to incremenation. I have a space delimited text file contain several rows of data that look like this:
33000.000 33000.060 -5277.000000 1124.000000 -4138.000000 -3.000000 -5.000000
33001.000 33001.060 -5278.000000 1125.000000 -4139.000000 -4.000000 -6.000000
33002.000 33002.060 -5279.000000 1126.000000 -4140.000000 -5.000000 -7.000000
For processing purposes, I need to increment each data element by an equal value (in each row) several times and save the resulting data to a file. For example, if I want to increment each row equally by .2, the output would be:
33000.000 33000.060 -5277.000000 1124.000000 -4138.000000 -3.000000 -5.000000
33000.200 33000.260 -5277.200000 1124.200000 -4138.200000 -3.200000 -5.200000
33000.400 33000.460 -5277.400000 1124.400000 -4138.400000 -3.400000 -5.400000
33000.600 33000.660 -5277.600000 1124.600000 -4138.600000 -3.600000 -5.600000
33000.800 33000.860 -5277.800000 1124.800000 -4138.800000 -3.800000 -5.800000
33001.000 33001.060 -5278.000000 1125.000000 -4139.000000 -4.000000 -6.000000
33001.200 33001.260 -5278.200000 1125.200000 -4139.200000 -4.200000 -6.200000
33001.400 33001.460 -5278.400000 1125.400000 -4139.400000 -4.400000 -6.400000
33001.600 33001.660 -5278.600000 1125.600000 -4139.600000 -4.600000 -6.600000
33001.800 33001.860 -5278.800000 1125.800000 -4139.800000 -4.800000 -6.800000
33002.000 33002.060 -5279.000000 1126.000000 -4140.000000 -5.000000 -7.000000
33002.200 33002.260 -5279.200000 1126.200000 -4140.200000 -5.200000 -7.200000
33002.400 33002.460 -5279.400000 1126.400000 -4140.400000 -5.400000 -7.400000
33002.600 33002.660 -5279.600000 1126.600000 -4140.600000 -5.600000 -7.600000
33002.800 33002.860 -5279.800000 1126.800000 -4140.800000 -5.800000 -7.800000
33003.000 33003.060 -5280.000000 1127.000000 -4141.000000 -6.000000 -8.000000
I’ve searched for an existing MATLAB function that will accomplish this and found nothing.
Can something like this be done in MATLAB? If so, any ideas?

Best Answer

PT, I had to make a couple minor modifications. But this runs like a champ! Thank you.