what is wrong with readmatrix()?

I'm using R2022a to finish my homework,but readmatrix() is not functioning properly
A=readmatrix('database.txt','Range','A1:D150');
The command runs right on the local runner,but once I run on my own Matlab R2022a ,it will say that "improper use of readmatrix,not enough input arguments":
choose"pause on errors"and the result:
However,a few weeks ago there is no mistake of readmatrix.I can't believe that I didn't change my code but the Matlab itself get something wrong.That's wierd.Files below are my all whole project so far.Can anyone help me?Thanks a lot!

댓글 수: 7

Matt J
Matt J 2023년 5월 20일
편집: Matt J 2023년 5월 20일
As you can see from the Run output in your post, the command works fine and produces output. Something in the enviornment on your local machine must be interfering.
As @Matt J says, it's got to be something you've done inadvertently--first, what does
which -all readmatrix
return? That would show any alias you may have created accidentally. If that appears normal, try a "clear all" and then execute the command from the command line and see if that fixes whatever it was...save any variables you need that were hard to generate to a .MAT file with SAVE first, of course.
After that, we'd have to see the full error message in context of the code that was run to have any chance of finding something; standing alone the function will execute normally for anybody here just trying it.
宇昊 彭
宇昊 彭 2023년 5월 20일
>> which -all readmatrix
D:\Matlab\toolbox\matlab\iofun\readmatrix.m
D:\Matlab\toolbox\shared\io\general\+matlab\+io\@ImportOptions\ImportOptions.m % matlab.io.ImportOptions method
Could you please tell me whether it is normal or not?
宇昊 彭
宇昊 彭 2023년 5월 20일
And "clear all" did nothing.I even tried to uninstall Matlab and reinstall Matlab R2022.All of the mentioned above are in vain.
Image Analyst
Image Analyst 2023년 5월 21일
편집: Image Analyst 2023년 5월 21일
If you have any more questions, then
attach your code with the paperclip icon
after you read this:
There is likely something you're doing in the rest of your code that is not shown in the one line snippet that you gave us.
Stephen23
Stephen23 2023년 5월 21일
Perhaps some other function you have created/saved is interfering:
宇昊 彭
宇昊 彭 2023년 5월 21일
Thanks a lot! I did not understand the question along with the answer.Just then I read carefully and I change the function name "mode" to "damage".The problem has been solved.Thanks a lot!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

질문:

2023년 5월 20일

댓글:

2023년 5월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by