フィルターのクリア

Simple vector question.

1 回表示 (過去 30 日間)
Sebastian Daneli
Sebastian Daneli 2022 年 4 月 4 日
コメント済み: Sebastian Daneli 2022 年 4 月 4 日
Say that I have the vectors
v1=[1 2 3]
v2=[4 3 8]
how can I, by using these two, create the following vector
v3=[4 3 3 8 8 8]
i.e., a vector with one 4s, two 3s and three 8s.

採用された回答

David Hill
David Hill 2022 年 4 月 4 日
v=repelem(v2,v1);
  3 件のコメント
David Hill
David Hill 2022 年 4 月 4 日
sum(~isnan(X),2)
Sebastian Daneli
Sebastian Daneli 2022 年 4 月 4 日
Great, thanks.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by