How do you find the 10 entry in this program

How do you find the 10 entry in this program
myMatrix = zeros(6,4);
for i = 1:6
for j = 1:4
myMatrix(i,j) = i+j;
end
end

Answers (1)

MATLAB stores arrays in column-wise. You can get 10th element using
iwant = myMatrix(10) ;

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Asked:

on 19 Apr 2020

Answered:

on 19 Apr 2020

Community Treasure Hunt

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

Start Hunting!