How to import Pushbutton results into Excel file?

3 ビュー (過去 30 日間)
Linda Hornakova
Linda Hornakova 2017 年 11 月 20 日
編集済み: Linda Hornakova 2017 年 11 月 30 日
Hello, I am new to MATLAB. I have two push buttons in my GUI- OK / N-OK a I need to import ok/n-ook into excel file depending which button is pushed. Can anyone help me please?
  2 件のコメント
Jan
Jan 2017 年 11 月 20 日
Which data do you want to "import"?
Linda Hornakova
Linda Hornakova 2017 年 11 月 20 日
I need to be written in the excel sheet ok or n-ok. I have several picutes which I upload to my GUI and 2 push buttons in the GUI: OK a N-OK. And as an output I need excel file with 2 columns: picture (1-20) and results (OK or N-OK). I hope I make sense at least little bit. It is my first time using it, so sorry for any misunderstandings. Thank you

サインインしてコメントする。

回答 (1 件)

PG_Dev
PG_Dev 2017 年 11 月 21 日
編集済み: PG_Dev 2017 年 11 月 24 日
Linda
If I understand your question correctly, you can use a table in the GUI with the 2 columns (using uitable). You can enter the picture names on one column and then update OK/N-OK by pressing pushbuttons. And then you can export the table contents to an Excel sheet using another push button(using xlswrite)
Regards
PG
  1 件のコメント
Linda Hornakova
Linda Hornakova 2017 年 11 月 30 日
編集済み: Linda Hornakova 2017 年 11 月 30 日
Thank you, very good idea.
I am currently using these codes, where 0=OK, 1=S-OK and -1=KO. But is at able instead of the numbers having the letters in the column?
>> % --- Executes on button press in OK.
>> function OK_Callback(hObject, eventdata, handles)
>> % hObject handle to OK (see GCBO)
>> % eventdata reserved - to be defined in a future version of MATLAB
>> % handles structure with handles and user data (see GUIDATA)
>> data = get(handles.uitable1, 'data');
>> data(end+1,:) = 0;
>> set(handles.uitable1,'data',data)
Is also possible while adding the rows, changing the name of the rows from 1 - n, to eg. A1,A2,A3, etc.?
Thank you!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by