0

y is MxN matrix with data. I need to take a specific element form each column when x (1xN vector) contains the row positions:

y(x(1),1)
y(x(2),2)
y(x(3),3)
y(x(4),4)

I search for a "Matlabic" way to do this, without a loop.

Of course y(x,:) is not the way. I thought of y(x+[0:N:N*M-1]).

Is there a more formal way?

CSchulz
  • 10,882
  • 11
  • 60
  • 114
Neuron
  • 515
  • 4
  • 8

0 Answers0