creating additonal rows of NaN in specific positions
Show older comments
Dear all,
I have a large matrix (double array of dimension 80000 by 21) and I want to create NaN rows in specific positions.
I have set up a rule [find(gg>300)] according to which I know the positions at which I want to create an additional row that will contain NaNs
For instance, let’s start with a simple example
A=[
2.4332 4.1477;
2.6073 4.5900;
2.2310 3.7442;
2.4555 4.1178;
2.5096 4.1946;
2.7517 4.7802;
2.8372 4.9423;
2.9577 5.1563;
3.2365 5.6061;
3.0658 5.3787;
2.9244 5.0497;
2.6104 4.4623;
2.5419 4.4164;
2.4947 4.3577;
2.5633 4.7050
]
Suppose that the criterion “find” tells me that I have to create additional rows of NaNS in positions 2,4,5,10 Then I want to have
A=[
2.4332 4.1477;
2.6073 4.5900;
NaN NaN
2.2310 3.7442;
2.4555 4.1178;
NaN NaN
2.5096 4.1946;
NaN NaN
2.7517 4.7802;
2.8372 4.9423;
2.9577 5.1563;
3.2365 5.6061;
3.0658 5.3787;
NaN NaN
2.9244 5.0497;
2.6104 4.4623;
2.5419 4.4164;
2.4947 4.3577;
2.5633 4.7050
]
thanks
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!