NaN を空白に置き換えるには、行列を文字列配列に変換した後に NaN を空白と置き換える必要があります。例えば、次のようなコードで行列 A の NaN を空白と置き換えることができます。
B = num2str(A)'; % 数値を文字列に変換
I = strfind(B(:)','NaN'); % NaNs を検索
B([I I+1 I+2]) = ' '; % NaN を空白と置換
A = B' % 結果の表示
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!