dlmwrite gives error message Too many output arguments.
古いコメントを表示
Dear Sir/Madam,
I have installed Matalb2018b on my Mac OSX 10.13.6. I am trying to use the function dlmwrite but it gives the error message: Too many output arguments. I am using a simple example from the dlmwrite help page. Please follow the commands given in the Command Windows:
>> M = magic(3);
>> dlmwrite dlmwrite('myFile.txt',M)
Error using dlmwrite (line 104)
Too many output arguments.
>>
>> dlmwrite("myFile.txt",M)
Error using dlmwrite (line 104)
Too many output arguments.
>>
>> which all dlmwrite
built-in (/Applications/MATLAB_R2018b.app/toolbox/matlab/ops/all)
>>
>> dbtype 'dlmwrite' 1
1 function dlmwrite(filename, m, varargin)
dlmwrite gives the "Too many output arguments" error message with Matlab 2018b and Matlab 2017b. Instead dlmwrite works fine with MAtlab 2016b and Matlab 2015a. All these versions are installed on this Mac.
Thank you
5 件のコメント
Do not just go through the motions of checking, you actually need to look at what you are doing:
>> which all dlmwrite
built-in (/Applications/MATLAB_R2018b.app/toolbox/matlab/ops/all)
% ^^^^ what is this?
Look at the second line: is that really the function you wanted to check? Or did you use the wrong syntax for which and actually checked the function all ? (hint: you used the wrong syntax).
Show us the output of this command:
which dlmwrite -all
% ^ you forgot this! Check the documentation.
Jan
2019 年 1 月 22 日
Is
>> dlmwrite dlmwrite('myFile.txt',M)
a typo?
Davide
2019 年 1 月 22 日
Jan
2019 年 1 月 22 日
[MOVED from section for answers] Davide wrote:
Right, sorry
Here is the output of the command you suggested
>> which dlmwrite -all
/Applications/MATLAB_R2018b.app/toolbox/matlab/iofun/dlmwrite.m
Okay, than you are using the original version of dlmwrite. I assume, you have shadowed another function, which is called from inside dlmwrite. You can find this out using the debugger - see my answer.
By the way, thank you for saluting "Madams" explicitly. There are to many "hello guys" in this forum. :-)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!