フィルターのクリア

severe problems opening files with Matlab 2018a

3 ビュー (過去 30 日間)
Jason Jury
Jason Jury 2018 年 6 月 18 日
コメント済み: Walter Roberson 2018 年 12 月 14 日
When I try to open a file in Matlab 2018a, I get the following error:
>> open check_adc_vs_fir_samples.m
Error using open (line 146)
PATTERN must be a string scalar or character vector.
Cannot open file using dialog box either, I get same error message popping up as error dialog.
I'm an expert user of Matlab over 15 years, this is the first version of Matlab that I've seen this error. Normally I'm able to debug but can't resolve this on my own. Need Mathworks support.
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 18 日
Can you do
which -all open
I suspect that you have an open.m on your path that is not provided by Mathworks.

サインインしてコメントする。

採用された回答

Jason Jury
Jason Jury 2018 年 6 月 18 日
I figured out the problem. I had made my own function for "contains.m" because I was using older Matlab versions (e.g. 2015b) that didn't have this function implemented. My version of this function was confusing Matlab 2018a obviously. If I remove my version of contains.m from the path, then Matlab 2018a works correctly. Thank you.

その他の回答 (4 件)

Thomas Arnold
Thomas Arnold 2018 年 11 月 2 日
You can also try typing restoredefaultpath into the terminal, that should remove any conflicting files.
  1 件のコメント
Alessandra Caporale
Alessandra Caporale 2018 年 11 月 20 日
Thank you!!! I would like to share my experience with you, with the hope it might help someone in the future!
In my new desktop pc with Windows 10 installed, I was trying to get rid of OneDrive, and I had moved all the files that were in OneDrive\Documents into myPC\Documents. Now during this process, by opening Matlab I got this message
Warning:
"C:\Users\username\OneDrive\Documenti\folder\subfolder
selected using the Last Working Folder preference could not be accessed.
Using "C:\Users\username\Documents\MATLAB" as the initial working folder instead.
Within my myPC\Documents I could open all the MATLAB figures, but I couldn't open any of the scripts (.m files) contained in the script folder. When I tried to do it, I got the error dialog box 'Error using open (line 146) PATTERN must be a string scalar or character vector'.
Solution:
I typed restoredefaultpath in the command window, and now it works nicely!
Thank you!

サインインしてコメントする。


Jason Jury
Jason Jury 2018 年 6 月 18 日
I don't see anything below that wasn't installed by Matlab
>> which -all open
C:\Program Files\MATLAB\R2018a\toolbox\matlab\general\open.m
C:\Program Files\MATLAB\R2018a\toolbox\shared\asynciolib\+asyncio\Channel.m % asyncio.Channel method open is a built-in method % asyncioimpl.Channel method
C:\Program Files\MATLAB\R2018a\toolbox\matlab\graph2d\@scribehandle\open.m % scribehandle method
C:\Program Files\MATLAB\R2018a\toolbox\instrument\instrument\@icdevice\open.m % icdevice method
C:\Program Files\MATLAB\R2018a\toolbox\shared\instrument\@instrument\open.m % instrument method
C:\Program Files\MATLAB\R2018a\toolbox\matlab\serial\@serial\open.m % serial method
C:\Program Files\MATLAB\R2018a\toolbox\sl3d\sl3d\@vrworld\open.m % vrworld method
C:\Program Files\MATLAB\R2018a\toolbox\simulink\simulink\upgradeadvisor\@UpgradeAdvisor\open.p % UpgradeAdvisor method
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 18 日
In your Preferences, Editor/Debugger, do you have MATLAB editor selected, or Text Editor with a program name?

サインインしてコメントする。


Jason Jury
Jason Jury 2018 年 6 月 18 日
Incidentally, I get the same error using built-in "edit" function:
>> edit zipfrnd.m
Error using edit (line 66) PATTERN must be a string scalar or character vector.
>> which -all edit
C:\Program Files\MATLAB\R2018a\toolbox\matlab\codetools\edit.m
C:\Program Files\MATLAB\R2018a\toolbox\matlab\graph2d\@axischild\edit.m % axischild method
C:\Program Files\MATLAB\R2018a\toolbox\sl3d\sl3d\@vrworld\edit.m % vrworld method

DelfinDelfin
DelfinDelfin 2018 年 12 月 14 日
I have the same problem .. Whey I type
which -all open
I get:
C:\Program Files\MATLAB\R2018a\toolbox\matlab\general\open.m
C:\Program Files\MATLAB\R2018a\toolbox\shared\asynciolib\+asyncio\Channel.m % asyncio.Channel method
open is a built-in method % asyncioimpl.Channel method
C:\Program Files\MATLAB\R2018a\toolbox\matlab\graph2d\@scribehandle\open.m % scribehandle method
C:\Program Files\MATLAB\R2018a\toolbox\instrument\instrument\@icdevice\open.m % icdevice method
C:\Program Files\MATLAB\R2018a\toolbox\shared\instrument\@instrument\open.m % instrument method
C:\Program Files\MATLAB\R2018a\toolbox\matlab\serial\@serial\open.m % serial method
C:\Program Files\MATLAB\R2018a\toolbox\sl3d\sl3d\@vrworld\open.m % vrworld method
C:\Program Files\MATLAB\R2018a\toolbox\simulink\simulink\upgradeadvisor\@UpgradeAdvisor\open.p % UpgradeAdvisor method
Help
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 12 月 14 日
Try
restoredefaultpath
rehash toolboxcache
and then try again.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by