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 Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by