How to store a value obtained from a for loop in a matrix?

1 回表示 (過去 30 日間)
Ajad Singh
Ajad Singh 2022 年 1 月 30 日
編集済み: Cris LaPierre 2022 年 1 月 30 日
I am trying to store the value of i, which i have obtained from a for loop, into a 1x13 matrix however the array that is produced is the following array from 1 to 13. So i would like the value of 7 to be in the position where the 5 is located and 8 to be where 6 is located. New to matlab so apologies if this is a trivial question. EDIT: The value of i is often random and can vary in length.

採用された回答

Cris LaPierre
Cris LaPierre 2022 年 1 月 30 日
編集済み: Cris LaPierre 2022 年 1 月 30 日
You can learn more about for loops in Ch 12 of MATLAB Onramp.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by