0

Doesn't Matlab allow chaining of matrix operations with indexing?

For eg.:

a = [1 2; 3 4];
exp(a)(:)

throws the error

Error: ()-indexing must appear last in an index expression.

It seems like this is something I would have expected Matlab to have or is there a different way to do this?

Sandman
  • 5,432
  • 5
  • 20
  • 23
  • @OliCharlesworth: Ahh yes, definitely duplicate! :) Not sure what the correct course of action is in this scenario. Should I pull down my question? – Sandman Mar 08 '14 at 20:50
  • Not unless you want to, the other questions will be referenced. See also http://stackoverflow.com/a/19306017/2778484. – chappjc Mar 09 '14 at 00:45

1 Answers1

1

You don't need the indexing colon. The below should work.

a = [1 2; 3 4];
exp(a);
David
  • 23
  • 6