How to do a matrix like this??

how to do a matrix like this in a loop,[1 2 3 ... 10,
1 4 9 ... 100
1 8 27... 100]

 Accepted Answer

Bruno Luong
Bruno Luong on 16 Sep 2019
Edited: Bruno Luong on 16 Sep 2019
(1:10).^((1:3)')
or on older MATLAB
bsxfun(@power,1:10,(1:3)')

More Answers (0)

Products

Tags

Asked:

on 16 Sep 2019

Commented:

on 16 Sep 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!