0

Is it possible to extract elements from matrix in one expression for slicing operators:

([1 2 3; 4 5 6] * [1 2 3]') (1:2)

Without using intermediate variable

tmp=[1 2 3; 4 5 6] * [1 2 3]';

tmp(1:2)
Dan
  • 45,079
  • 17
  • 88
  • 157
Konstantin Burlachenko
  • 5,233
  • 2
  • 41
  • 40
  • (1) I'm not sure that via "subsref" it is possible to exrtact rows&columns from matrix. (2) I'm interesting in language expressions mostly (3) Right now I'm working in matlab 2015. Post was created at 2011 year. – Konstantin Burlachenko Apr 26 '16 at 05:24
  • 3
    Matlab still does not allow direct indexing of literals; the duplicate is still the best Matlab can do. – TroyHaskin Apr 26 '16 at 05:34

0 Answers0