Align multiple columns by their center index value
Show older comments
I have a matrix with 3 columns with different number of values in each (each column has an odd number of values) and i'd like to align the columns by their center index value. e.g. something like below, underlined are center values per column
Original matrix
1 1 1
2 2 2
3 3 3
NaN 4 4
NaN 5 5
NaN NaN 6
NaN NaN 7
NaN NaN NaN
NaN NaN NaN
Aligned matrix
NaN NaN NaN
NaN NaN 1
NaN 1 2
1 2 3
2 3 4
3 4 5
NaN 5 6
NaN NaN 7
NaN NaN NaN
I am a newcomer to Matlab, any tips on how to go about tackling this is great appreciated!!
Accepted Answer
More Answers (0)
Categories
Find more on NaNs 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!