How to increase matrix size by inserting nan

6 ビュー (過去 30 日間)
LISSA DUVVU
LISSA DUVVU 2020 年 2 月 10 日
コメント済み: LISSA DUVVU 2020 年 2 月 10 日
I have a matrix of size 1x24, now i want to add nan's to that matrix in a order like from 1 to 59 i want nan and 60 is my first variable again from 60 to 119 nan and 120 is my second value, so that my final matrix size will be 1x1440
any help
thanks
  1 件のコメント
LISSA DUVVU
LISSA DUVVU 2020 年 2 月 10 日
Thank you

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

採用された回答

KSSV
KSSV 2020 年 2 月 10 日
Let A be your 1*24 array.
iwant = NaN(60,24) ;
iwant(1,:) = A ;
iwant = iwant(:) ;
  2 件のコメント
Bhaskar R
Bhaskar R 2020 年 2 月 10 日
>> find(~isnan(iwant))
ans =
1
61
121
181
241
301
361
421
481
541
601
661
721
781
841
901
961
1021
1081
1141
1201
1261
1321
1381
KSSV
KSSV 2020 年 2 月 10 日
What OP wants can be obtained by
iwant(end,:) = A ;
We have given a example code...he should be able to get it done to his required.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by