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

 Respuesta aceptada

Adam Danz
Adam Danz el 22 de Abr. de 2020

1 voto

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

8 comentarios

Steven Lord
Steven Lord el 22 de Abr. de 2020
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.
Erik Taurus
Erik Taurus el 22 de Abr. de 2020
Editada: Erik Taurus el 22 de Abr. de 2020
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 el 22 de Abr. de 2020
Editada: Adam Danz el 22 de Abr. de 2020
A common solution that avoids WriteMode is to read in the excel file, append the data, and write it again.
Adam Danz
Adam Danz el 22 de Abr. de 2020
"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 :)
Erik Taurus
Erik Taurus el 23 de Abr. de 2020
"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.
Erik Taurus
Erik Taurus el 27 de Abr. de 2020
Thanks again ^^
Sue-Jin Lin
Sue-Jin Lin el 13 de Ag. de 2021
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.

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 22 de Abr. de 2020

Comentada:

el 13 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by