필터 지우기
필터 지우기

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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by