필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

MATLAB help with using nested loops in matricies

조회 수: 1 (최근 30일)
Blake Sewell
Blake Sewell 2020년 9월 1일
마감: MATLAB Answer Bot 2021년 8월 20일
Ok I'm posting a second time as I was informed on my last post that I need to show my attempt of coding towards the part to recieve help. In part 3 of my workshop assignment, I've gotten as far as to get the first 10 rows in a z=zeros(20,10) but I am unsure on what to do to get the remaining 10 rows at the bottom as they all still display zeros.
My code is as follows:
z=zeros(20,10);
for x = 1:10
for y=1:10
z(x,y)=2*x+y^2;
end
end
disp(z)
and this is what it looks like when I click run:

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 9월 1일
for x = 1:size(z,1)
  댓글 수: 1
Blake Sewell
Blake Sewell 2020년 9월 1일
Thankyou very much, appreciated <3

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by