Matlab excel sheet app.

1 次查看(过去 30 天)
Adithya Narasimhan
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
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