arrays - Creating a 2D matrix in Matlab -
i want create matrix like
a = [1 2 3 ;4 5 6; 7 8 9];
i want this,
a = 1 + val : 1 : 3 + val ; val = [0 3 6];
but getting [1 2 3]
, not 2d matrix .
try this,
val = [0 3 6]; = bsxfun(@plus,val',1:3); = 1 2 3 4 5 6 7 8 9
arrays matlab matrix vector
No comments:
Post a Comment