How to perform operations on time matrices
Show older comments
Ok so my problem stems from the analysis of measurements taken from images.
I have an excel sheet where I have a table of measurements where each column is a different cell (replicate) and the rows are the different time points in which the measurements were taken.
I now want to polish the data, exclude replicates (columns) when necessary and do multiple different operations with the values: i.e. calculating the mean value at time 1 between all of the columns and subtracting that to every element of the matrix; translate the column values to the top in order for them to start with the first positive number and eliminating any negative number after that by 'pushing together' the values below.
I.e. my matrix would be a = 0 2.3450 3.4570
1.0000 3.4670 4.8750
2.0000 4.6350 5.8350
I would first like to calculate the mean of the values of the first row (2.345 and 3.457) = 2.901
Then substract that to every value of the matrix i.e. a = 0 -0.5560 0.5560
1.0000 0.5660 1.9740
2.0000 1.7340 2.9340
Then I eliminate any negative value by filling the gaps with the lower values on the column i.e. a= 0 0.5660 0.5560
1.0000 1.7340 1.9740
2.0000 0 2.9340
If the matrix instead was c = 0 0.5660 0.5560
1.0000 1.7340 -1.6460
2.0000 0 2.9340
I would want the matrix to become c = 0 0.5660 0.5560
1.0000 1.7340 2.9340
2.0000 0 0
Is there any function or operation that could help me do those kind of modifications to the matrix?
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!