Matrix indexing question for code generation

조회 수: 1 (최근 30일)
Lenin Cruz
Lenin Cruz 2019년 9월 19일
댓글: Adam 2019년 9월 19일
Suppose you have the following 4x4 Matrix
M= [10 15 20 21;...
11 18 27 99;...
13 45 16 10;...
19 21 31 51;]
It is true that when you do the following call
M(6)
The result is going to be 18 because MATLAB element numbers are counted in columns isn't it?
My question is if this is going to have impact when generating C code as in C for matrix indexing you have to specify the number of raw and column to call an element.
Thanks a lot
  댓글 수: 1
Adam
Adam 2019년 9월 19일
I imagine it should work fine. Matrices are not really a concept in C (without libraries) are they? Everything is stored as a linear set of values anyway, under the hood, as far as I am aware.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by