MATLAB Answers

Difference between values and indices?

7 views (last 30 days)
Jack
Jack on 5 Oct 2017
Commented: Jack on 5 Oct 2017
Can someone give an explanation of the difference between the values of elements in a matrix vs. the indices of elements in a matrix?
Thanks.

  0 Comments

Sign in to comment.

Accepted Answer

Mischa Kim
Mischa Kim on 5 Oct 2017
Edited: Mischa Kim on 5 Oct 2017
E.g.
A = [1 2; 3 4]
Values of/in A are 1,2,3,4. To access the 2 you would use
val = A(1,2)
(1,2) are the indices of the element of A whose value is 2.

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by