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

2 views (last 30 days)
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.

Accepted Answer

Steven Lord
Steven Lord on 3 Jul 2020
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

More Answers (1)

betul
betul on 27 Oct 2023
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 Comments
betul
betul on 1 Nov 2023
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 on 1 Nov 2023
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 .

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!