Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function errorBars2 in testfunctions.m requires count.dat #10

Closed
mbauman opened this issue Feb 1, 2011 · 4 comments
Closed

function errorBars2 in testfunctions.m requires count.dat #10

mbauman opened this issue Feb 1, 2011 · 4 comments

Comments

@mbauman
Copy link
Contributor

mbauman commented Feb 1, 2011

Line 738 of testfunctions.m calls load count.dat, but there is not a count.dat file in the repository.

@nschloe
Copy link
Member

nschloe commented Feb 2, 2011

Well that shouldn't be needed either. MATLAB(R) includes that file for testing purposes by default. 'load count.dat' works for me on the command line. -- Not for you?

@mbauman
Copy link
Contributor Author

mbauman commented Feb 2, 2011

Ah, I understand the issue now. You are right, I do have count.dat, and load count.dat functions as expected from the command line. The problem is that I also have a local function count.m in my PATH. While local variables should supersede functions, it appears as though if they're not declared within that scope then MATLAB uses the function first.

Explicitly saying count = load('count.dat'); is more robust.

Thanks for all the work on this! I really appreciate all it can do.

@nschloe
Copy link
Member

nschloe commented Feb 2, 2011

i just put a count.m in my path (hence "declaring" an entity 'count'), loaded count.dat, and the result is that there is now a variable 'count' containing the expected data. I don't really understand how that screws your test function, but I admit this is ugly and I prefer your suggestion of assigning the count variable more explicitly.
Will commit that now. Thanks!

@mbauman
Copy link
Contributor Author

mbauman commented Feb 2, 2011

Yeah, interactively (on the command line) things behave as you expect. However, within the test function, MATLAB seems to not recognize that a variable count is in the workspace if it's not explicitly assigned to... and so it calls the function count instead.

It's a strange bug (or implementation limitation). I can't seem to put the correct search together to find any documentation about it, though. (Edit: Aha! See here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/161463) Thanks again!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants