matrix array for loop

for example i have a data ... x 2
for the row i have 2000 and col i have 2
i want to using length() to get both col and all the row together
for example for loop like this
given fuction[total] = cal (getboth)
for i : 1: length(getboth)
% but i want to find both or the col and row
% like something like this.
--getboth(i,1) this is for only colum 1 but i want to get both 2 colum, also i want to loop all the row too.

Respuestas (1)

Jan
Jan el 12 de Oct. de 2021
Editada: Jan el 12 de Oct. de 2021

0 votos

See the command: size()
By the way, you find such commands, when you know an almost matching command, in the documentation: Look for the "See also" line at the bottom of
doc length
The size() command is mentioned there.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Preguntada:

el 12 de Oct. de 2021

Editada:

Jan
el 12 de Oct. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by