필터 지우기
필터 지우기

how to iterate over a table using a for with arrays

조회 수: 2 (최근 30일)
Jessica Blasco
Jessica Blasco 2018년 5월 14일
댓글: Ameer Hamza 2018년 5월 14일
I have a table in which I must iterate over two columns, in one it contains numbers and in the other arrays ...
table type zone value 1 lateral 1 lower 1 higher 2 lateral 2 lower 2 extreme
so that if a certain value is met for each type and zone, it can be stored where it was given (alarm) in another column of the same table

답변 (1개)

Ameer Hamza
Ameer Hamza 2018년 5월 14일
You can access column entries similar to an array. For example
table1.var1(1)
will access the first entry in column var1. You can use it in for loop similar to an array.
You can also use arrayfun(), but how to use it will depend on the type of your dataset.
  댓글 수: 2
Jessica Blasco
Jessica Blasco 2018년 5월 14일
thanks! But I don't understand it totally.... Could you write me the code? i have one columns with values that are repeated them, idem for the second column, but these columns are join for condition. valor columna 1...valores a b c... valor columna 2... valores a b c
for i= 1: 8 %column1
for j= a b c %values column 2
....
Ameer Hamza
Ameer Hamza 2018년 5월 14일
It is difficult to understand your question like this. If possible, please attach your sample dataset as a mat file containing the table.

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

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by