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
采纳的回答
8 个评论
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
2020-4-22
编辑:Erik Taurus
2020-4-22
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.
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.
- 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.
- 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.
- 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.
Thanks again ^^
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.
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Structured Data and XML Documents 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
