need an empty space in a column

3 ビュー (過去 30 日間)
Moon Datta
Moon Datta 2012 年 11 月 2 日
I have a matrix like this
1 4
2 5
3 2
4 0
5 6
6 1
Now I want to delete the 0 from the column 2 but if I delete this the corresponding position is beibg deleted and 6 is coming to this place. but I need the 0 should be deleted and it will also keep the space blan. It would look like
1 4
2 5
3 2
4
5 6
6 1
how to solve the problem?
thanks in advance

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 11 月 2 日
a = [1 4
2 5
3 2
4 0
5 6
6 1];
a(a(:,2) == 0,2) = nan;
  1 件のコメント
Moon Datta
Moon Datta 2012 年 11 月 2 日
Thank you Sir

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by