how to add nan values to existing array?

5 ビュー (過去 30 日間)
Suresh R
Suresh R 2021 年 11 月 3 日
コメント済み: the cyclist 2021 年 11 月 3 日
how to add nan values to existing array? i have 1X5 array.i want to change size to 10x5.
  2 件のコメント
Johan
Johan 2021 年 11 月 3 日
You can try this
A = rand(1,5)
A = 1×5
0.5817 0.9565 0.1770 0.5972 0.9275
A = [A;NaN*(ones(9,5))]
A = 10×5
0.5817 0.9565 0.1770 0.5972 0.9275 NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
the cyclist
the cyclist 2021 年 11 月 3 日
You can do
nan(9,5)
rather than
NaN*(ones(9,5))

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by