Appdesigner: Writing Data To Excel

% 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 日

1 投票

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 件のコメント

I
I 2021 年 3 月 29 日
How should I go about saving an imported excel table after editing?
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

質問済み:

I
I
2021 年 3 月 28 日

コメント済み:

I
I
2021 年 4 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by