Matlab excel sheet app.

조회 수: 8 (최근 30일)
Adithya Narasimhan
Adithya Narasimhan 2021년 4월 5일
답변: Pratheek Punchathody 2021년 4월 8일
I am trying to make an matlab using app designer where if we press the read button it should create and new excel sheet and should display the data on the UI table. After that I tried to put some values on matlab edit field and created an add buttopn that show add my new data to the table sheet and should display it on the UI table. But I am unable to append data. I tried using writetable but it just overwrites my previous data. I need help in appending data to excel.
  댓글 수: 1
Mario Malic
Mario Malic 2021년 4월 5일
Your question is not clear. What you should do is to load the table from Excel, display it in UITable component, make changes to UITable component in App Designer and write it back to Excel.
Otherwise, take a look at this example.

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

답변 (1개)

Pratheek Punchathody
Pratheek Punchathody 2021년 4월 8일
As per my understanding,
User has to enter the values in the edit field of the app and you need to take those inputs and append in the excel sheet which is already created. Also you need to read the updated data from the excel sheet and display it in the UITable.
For this, Initially let us consider that we are already having an existing excel sheet with 5 rows in it
Now that we have a new row of data stored in the form of 1x3 table - "newcolor" (data can be collected from the user input)
newcolor =
1×3 table
Var1 Var2 Var3
__________ __________ _________
{'purple'} {'800080'} {'False'}
Next step is to append the below data to the existing excel sheet. In this case I have considered "main.xls" as the existing excel sheet.
writetable(newcolor,'main.xls','WriteMode','Append','WriteVariableNames',false,'WriteRowNames',true)
After appending the data to the excel sheet below is the output we get.
Also you can refer to the documentation on Append Data to Bottom of Table using writetable. This has to be implemented with the UItable and push botton function.
Hope this helps..!

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by