How to do a matrix like this??

1 view (last 30 days)
fafa fafa
fafa fafa on 16 Sep 2019
Commented: fafa fafa on 16 Sep 2019
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)

Tags

Products

Community Treasure Hunt

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

Start Hunting!