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

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.

 Réponse acceptée

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 commentaire

Thanks a bunch.
Yeah, there was a folder I had downloaded months ago having a var.m file.

Connectez-vous pour commenter.

Plus de réponses (1)

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 commentaires

I do not seem to find a loadbv() function anywhere. The closest I find is pop_loadbv() which is part of the third party toolbox eeglab
yes, we use the function for eeglab toolbox and is originally pop_loadbv() (sorry that i made typo). I tried to run this function through matlab script and through eeglab interface. It works in windows well but not in mac even though I followed the same steps and procedures.
I need this function to import vhdr file and I think that the problem might be about the mac computer. I'd also appreciate if you help me to find another way to do so. I am really stuck at this point.
pop_loadbv is in the bva-io plugin that you would have to install.
If you are not using the latest eeglab there can be problems installing plugins https://www.mathworks.com/matlabcentral/answers/1845448-difficulty-installing-biosig-after-eeglab-install-on-macbook
The plugin seems to be installed and I am using the latest version of both eeglab and matlab. Matlab is on trial version. Do you think problem might be about that?
What is the full and exact text of the error message? If the message says that the function is unsupported (not that it is undefined) it may be that the function is implemented as a MEX-file and that file has not been compiled for the operating system you're using (Apple Silicon-based Mac perhaps? I think I remember other posts in Answers about eeglab and Apple Silicon Mac machines.) If so you may need to contact the authors of eeglab and ask them to provide you with the Apple Silicon-based Mac MEX-files (or maybe compile them yourself if you have the source code.)
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!
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 .

Connectez-vous pour commenter.

Catégories

Produits

Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by