How to display results in a table and same time save results do excel file

조회 수: 1 (최근 30일)
Hi, I have a code to predicting new data on an already trained model. How do I declare a property in app designer for the path where I import data from and also how do I display the prediction from the model in a table and at the same time save that result to an excel file when I click a button? Any code or example documentation would be appreciated. Thank you.

채택된 답변

Walter Roberson
Walter Roberson 2023년 5월 15일
how do I display the prediction from the model in a table and at the same time save that result to an excel file when I click a button
Start by creating a table object -- though using array2table or related functions can also be valuable.
When you have the table of data to display, set a uitable object's Data property to be the table to display.
And use writetable to write to excel file.
  댓글 수: 2
Learning
Learning 2023년 5월 17일
Thank you for your help. Also, I have a code generated from a trained ANN model using the ANN fitting tool in Matlab. I can pass new data through the code and get an output. I have a button called “Predict”. When I click this button I want the output of the code to be displayed in the table. Do I implement the code at the callback for the “Predict” button? Also do I set the output of the code as a property so I can use it in the callback for “Predict”?
Walter Roberson
Walter Roberson 2023년 5월 18일
Yes, the Predict button will likely call predict() or classify(), and after the code gets the results from that, put it into a Table and set the uitable's Data property to the table.
You can store the output of predict() or classify() as a property if you need it for other purposes beyond just displaying.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by