Using a variable value as linear array index

8 ビュー (過去 30 日間)
Ross Laws
Ross Laws 2017 年 2 月 7 日
コメント済み: Ross Laws 2017 年 2 月 7 日
Can you use a variable as an array index? for example: C = 200 - 30
then use C as the linear index for the array.
B(C)
This just multiplies B by C. Can you tell the program to just use the value of C?

採用された回答

Adam
Adam 2017 年 2 月 7 日
編集済み: Adam 2017 年 2 月 7 日
Yes
B(C)
will use C to index into B, it doesn't multiply at all.
Surely you could just try this out on the command line, it is how I learned a lot of what I know!
  1 件のコメント
Ross Laws
Ross Laws 2017 年 2 月 7 日
I just realised this. Im and idiot, thanks.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by