Reputation: 71
Let's assume the following:
A=rand(10,5);
How can I replace the first 3 rows of this table with NaN's, without the matrix losing its original dimension 10x5? Thanks in advance
Upvotes: 1
Views: 44
Reputation: 104555
Just index into the first three rows but ensure you select all of the columns and replace the entries with nan
:
A(1:3,:) = nan;
I have a minor comment. The variable A
is not a table
, but it is a matrix. Please ensure you use the right terminology from now on, as someone may confuse what you're saying with the actual table
construct.
Upvotes: 2