Replacing element of a matrix
1 回表示 (過去 30 日間)
古いコメントを表示
How to replace every n th element of matrix with some number
matrix has vertical shape
and is single row matrix
0 件のコメント
回答 (1 件)
Rik
2022 年 8 月 25 日
I suspect this is homework, so I'm only going to give you a suggestion:
You should have a look at the colon operator and how you can assign values to an array with indexing.
2:4
A=rand(1,5);
A(4)=5
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!