I get an error when I run a function on mac, but it works when run in Windows

3 次查看(过去 30 天)
Hi Everyone. I'm running a script using 'ischange'. This function works when run on my friend's Windows laptop but when I run the same script on my Mac, I get errors.
For example, when I just try the example of implementing the function from MATLAB's documentation I get an error.
Here is a demonstration.
Change in Mean
Create a vector of noisy data, and compute the abrupt changes in the mean of the data.
A = [ones(1,5) 25*ones(1,5) 50*ones(1,5)] + rand(1,15);
TF = ischange(A)
When I run the above two lines I get this error;
Error using var
Too many input arguments.
Error in ischange>cpnochange(line 260)
cost = n*var(a,1);
Error in ischange>cpmanual(line 239)
cost0 = cpnochange(a,statistic,x);
Error in ischange>ischangeArrayColumn(line 212)
cp = cpmanual(a,statistic,Lmin,penalty,x);
Error in ischange>ischangeArray(line 170)
TF(:,k) = ischangeArrayColumn(B(:,k),args{:});
Error in ischange(line 89)
[varargout{1:nargout}] = ischangeArray(A,method,x,numchanges,separation,threshold,dim);
Please help. Thanks.

采纳的回答

Steven Lord
Steven Lord 2020-7-3
Make sure you haven't written or downloaded your own var.m that's taking precedence over the var.m included in MATLAB. You can check this using:
which -all var

更多回答(1 个)

betul
betul 2023-10-27
Hi,
I have a similar problem. When I run loadbv function on windows it works but not in mac computer. It reports unsupported function. We prepared the script in windows. Path seems to be fine. We also tried with another alternative function, readbv, the error reporting persists. How can I fix it? Appreaciate your help!
  8 个评论
betul
betul 2023-11-1
The full exact message is that the function is not reported. I'll also attach a screenshot in case there'll be others who might face the same problem. My computer is silicon based Mac, so I should probably contact the developers. Thank you so much Steven!
Walter Roberson
Walter Roberson 2023-11-1
You have a pop_loadbw.m script in /Users/betul/ that is interfering with eeglab trying to use the plugin function .
The master copy of the plugin should not be in your MATLAB path. You should either use the eeglab plugin manager to install it, or else you should uncompress the downloaded plugin file in the main EEGLAB “plugins” sub-directory .

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by