writematrix: Invalid parameter name: WriteMode.

Matlab R2019b
For some reason this doesn't work for me.
I'm following the example here:
M2 = [5 10 15 20 25; 30 35 40 45 50];
writematrix(M2,'M.xls','WriteMode','append');
Result:
Error using writematrix (line 134)
Invalid parameter name: WriteMode.
Using the example with no extra parameters
writematrix(M2,'M.xls');
Works without problem
[Edit]
From the page: Introduced in R2019a

 Accepted Answer

WriteMode was not available in r2019a. Here's the documentation for writematrix r2019a.

8 Comments

The writematrix function was introduced in release R2019a. The WriteMode parameter in writematrix was introduced in release R2020a. You can see the two items in the Release Notes related to these changes.
Thanks for the answers, I was living under the impression that everthing on the page was avaiable for the version at the bottom of the page.
I'll see if we can upgrade to 2020a
Or read the Excel-file and get the current row(s) that way.
Adam Danz
Adam Danz on 22 Apr 2020
Edited: Adam Danz on 22 Apr 2020
A common solution that avoids WriteMode is to read in the excel file, append the data, and write it again.
"I was living under the impression that everthing on the page was avaiable for the version at the bottom of the page."
The release number at the bottom of the documentation just shows when the function was released. When an update contains a new feature such as WriteMode, there are three ways I know of to determine when the new feature was released.
  1. Look it up in the Release Notes as Steven Lord suggested. This often requires digging and some of the smaller changes, I've found, aren't mentioned or I haven't been able to find them in the release notes.
  2. Looking up the function in earlier version of the archives. With just a few clicks and a function search, you can quicly see the older versions of the documentation for a function but you still have to read through >1 version to find differences.
  3. If you have access to older versions of Matlab, you can run the function and compare outputs or error messages.
I really wish each page of the documentation contained a drop down menu containing releases starting with the first release for a function and that we could simply select an older release to immediately open the archived page for that function. This would solve a lot of problems, especially for newer users not using the latest release. Shout-out to the documentation team :)
"I really wish each page of the documentation contained a drop down menu containing releases starting with the first release for a function and that we could simply select an older release to immediately open the archived page for that function."
That would be awesome!
Thanks for the suggestions <3
I did take a look at the old documentation and that's how I finally managed to solve this, I also found the "help <function name>" feature today which does help or at least assist on what to look for on the internet.
I jumped down at the deep end of the pool with Matlab so I make assumptions which aren't correct obviously, learning how to read the documentation is a start :)
Also check out
doc <function name>
It's a bit slower but more comprehensive.
I had the same issue with WriteMode in the same version of Matlab. Then I created a table using mytable = table(mydata1, mydata2); and then used writetable(mytable,'myresults.txt') to save it.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!