Appdesigner: Writing Data To Excel

15 次查看(过去 30 天)
I
I 2021-3-28
评论: I 2021-4-1
% Button pushed function: WriteDataButton
function WriteDataButtonPushed(app, event)
w = writetable("Book1.xlsx","Sheet",1);
app.UITable.Data = w;
end
I can open an excel sheet with opentable, so I just assumed that writetable would work in the oppose way. I was wrong.
I have the error:
Error using writetable
Too many output arguments.
Is there a way to get this to work?

采纳的回答

dpb
dpb 2021-3-28
编辑:dpb 2021-3-28
writetable returns no arguments and needs the data to output as an argument -- read the doc first...
% Button pushed function: WriteDataButton
function WriteDataButtonPushed(app, event)
writetable(app.UITable.Data,"Book1.xlsx","Sheet",1);
end
  3 个评论
dpb
dpb 2021-3-29
What's wrong with writetable using proper syntax as shown?
I
I 2021-4-1
Nothing at all. It worked perfectly.

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by