How change only second number in a=ones(1,10)?
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
Dyuman Joshi
2024 年 1 月 16 日
Simply use indexing to change the element -
a = ones(1,10);
a(2) = 2
0 件のコメント
その他の回答 (1 件)
Jaime Abad Arredondo
2024 年 1 月 16 日
You should look at the syntax for array slicing. In matlab it's fairly easy. You would do something like:
a=ones(1,10);
disp(a)
a(2)=2;
disp(a)
Cheers!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!