필터 지우기
필터 지우기

How to make for loop to count items in excel sheet?!

조회 수: 1 (최근 30일)
Mariam Sheha
Mariam Sheha 2016년 5월 25일
댓글: Mariam Sheha 2016년 5월 28일
Hello every body;
i am having data listed in excel sheet contains 980 row and 30 column
Each row consists of zeroes and ones, I want to make a for loop to consider all ones adjacent to each row and name it by the number of each column. so finally i will have only one column that contains the different items correspond to 1 i.e --> Row1: [4,12,13,15,16,18,19,20,22,24,27]
can anyone help me to do such operation please??! Thanks A lot
  댓글 수: 2
Mariam Sheha
Mariam Sheha 2016년 5월 25일
Hello could anyone answer this one please ?!
dpb
dpb 2016년 5월 26일
Not until we can understand what it is you're asking for, no...
Give a small sample, 2 or 3 rows with a half-dozen columns should be more than enough to illustrate. Paste the data and the desired results as code and how you get the latter from the former.

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 5월 26일
num = xlsread('Data1.xlsx');
result = arrayfun(@(ROW) find(num(ROW,:)), (1:size(num,1)).', 'Uniform', 0);
  댓글 수: 1
Mariam Sheha
Mariam Sheha 2016년 5월 28일
It is awesome , Really i am very very thankful for your help...

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Export to MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by