フィルターのクリア

Matlab excel sheet app.

2 ビュー (過去 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 Center および File ExchangeDevelop 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