フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

GUIDE - Reading from excel sheet rows and store them

1 回表示 (過去 30 日間)
Ali Jaber
Ali Jaber 2016 年 4 月 4 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am reading from an excel sheet , I wrote this line to get the rows of matrix m, so that I have to send it (the matrix) as input to a function. But after the loop is ended all rows are considered as one row! I have to separate them by ';' and stores all of them in an array.
for i=1:10
data = xlsread(filename);
m=data(i,:);
handles.m=m;
guidata(hObject,handles)
end
So this is what I tried :
a{i} = strcat(m{i},';');
handles.a=a;
I was thinking that by this way after each row a semi comma will be added. But it doesn't work. How can I do that?

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 4 月 4 日
No loop.
data = xlsread(filename);
handles.m = data;
guidata(hObject, handles);
  2 件のコメント
Ali Jaber
Ali Jaber 2016 年 4 月 4 日
I want to read by rows not columns
Walter Roberson
Walter Roberson 2016 年 4 月 4 日
The above gives you an array with the same layout as you have in the spreadsheet. The things that appear across rows in the spreadsheet will appear across rows in the array.
If you need to switch the order then
handles.m = data.';
however that would be "by column" rather than "by row".

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by