for loop

조회 수: 1 (최근 30일)
mahaveer hanuman
mahaveer hanuman 2011년 7월 30일
i have a=2x10 i need to use second row element how can i do it
i=1:length(a) i get elements of first row then how abt second row
please help me

채택된 답변

Paulo Silva
Paulo Silva 2011년 7월 30일
a(1,:) %first row
a(2,:) %second row

추가 답변 (1개)

mahaveer hanuman
mahaveer hanuman 2011년 7월 30일
num = 100; source = randint(num,2);
i =num(1,:); j =num(2,:); parity = mod(source(i)+ source(j),2); index out of bound
  댓글 수: 1
Paulo Silva
Paulo Silva 2011년 7월 30일
good luck getting the second row from a scalar value like the one from num

댓글을 달려면 로그인하십시오.

카테고리

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