フィルターのクリア

What is wrong with code?

2 ビュー (過去 30 日間)
GEORGIOS BEKAS
GEORGIOS BEKAS 2018 年 1 月 3 日
編集済み: Birdman 2018 年 1 月 3 日
I want a matrix as follows:
n = 12
b = zeros(n,n)
b(1,:) = 1:n
b(2,:) = 1:n.^2
etc...
How can I express that in a loop form?

採用された回答

Birdman
Birdman 2018 年 1 月 3 日
編集済み: Birdman 2018 年 1 月 3 日
for i=1:n
b(i,:)=(1:n).^i;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by