how to insert same scalar as length of something?
古いコメントを表示
Let's suppose, A = [1, 2, 3, 4, 5] and B = [0].
I want to make second [0,0,0,0,0] whose length is 5.
Please Let me know how to do this
採用された回答
その他の回答 (1 件)
Abderrahim. B
2022 年 8 月 23 日
編集済み: Abderrahim. B
2022 年 8 月 23 日
Is this what you are trying to do?
A = [1,2,3,4,5] ;
myScalar = 2 ; % change this to the scalar value you want
B = myScalar*ones(size(A))
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!