for loop

6 Ansichten (letzte 30 Tage)
mahaveer hanuman
mahaveer hanuman am 30 Jul. 2011
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

Akzeptierte Antwort

Paulo Silva
Paulo Silva am 30 Jul. 2011
a(1,:) %first row
a(2,:) %second row

Weitere Antworten (1)

mahaveer hanuman
mahaveer hanuman am 30 Jul. 2011
num = 100; source = randint(num,2);
i =num(1,:); j =num(2,:); parity = mod(source(i)+ source(j),2); index out of bound
  1 Kommentar
Paulo Silva
Paulo Silva am 30 Jul. 2011
good luck getting the second row from a scalar value like the one from num

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by