Too many output arguments error

A = magic(5);
B = writematrix(A, 'M.xls');
command window:
Error using writematrix
Too many output arguments.
Error in faf (line 2)
B = writematrix(A, 'M.xls');

1 Comment

I really dont get why this started to happen suddenly...

Sign in to comment.

 Accepted Answer

writematrix doesn't return any outputs.
Just say:
writematrix(A, 'M.xls')
What do you intend to be stored in B?

2 Comments

thanks, that solved it
You're welcome!

Sign in to comment.

More Answers (0)

Tags

Asked:

on 2 Nov 2023

Commented:

on 2 Nov 2023

Community Treasure Hunt

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

Start Hunting!