From: Jonathan on 13 May 2010 12:33 Good morning, I have the following matrix: a =[ 3 1 3 2 9 3 4 2 NaN 8 1 12 10 1 99 2]; What I would like to do is where there are NaNs identified in the first column, values in the same rows but in the other columns are replaced with NaN values so the final matrix looks like: a =[ 3 1 3 2 9 3 4 2 NaN NaN NaN NaN 10 1 99 2]; Any thoughts on how to do this. Thanks Jon
From: Matt Fig on 13 May 2010 12:50 a(isnan(a(:,1)),:) = NaN
From: Jonathan on 13 May 2010 13:04 "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hshakb$1ih$1(a)fred.mathworks.com>... > a(isnan(a(:,1)),:) = NaN Thanks Matt, I figured out another way using Find but ypir approach is more elegant. Cheers Jon
|
Pages: 1 Prev: Using MatLab to communicate to a PS/2 port Next: closed loop in simulink |