Tuesday, November 03, 2015

Selecting Specific Elements in the matrix

Sometimes I would like to select elements in the Matlab matrix with their coordinate. However, if I used two arrays to get elements in Matlab it returns the rows and columns containing those elements. To get exact elements, I used following method where indx and indy is index coordinates:

A(sub2ind(size(A),indx,indy))

No comments:

#Freedom

https://www.amazon.com/exec/obidos/ASIN/1668078368?tag=simonsayscom&fbclid=IwY2xjawMM1q1leHRuA2FlbQIxMABicmlkETFzM3R0aWlEWDFOQWZMaVVMAR4...