I have downloaded herrorbar to create horizontal error bars but get an error?

2 views (last 30 days)
I have downloaded herrorbar from FEX and put it into my MATLAB folder where I am working.
The error I get is:
"Error: File: herrorbar.m Line: 1 Column: 19 Unexpected MATLAB operator."
Do I need to do something to install it properly?
Thanks in advance.
  2 Comments
John D'Errico
John D'Errico on 16 Mar 2017
Note that when you report an error and ask for help, show the ENTIRE error message. Not just part of it. That helps us to help you.
Adam
Adam on 16 Mar 2017
Obvious question would seem to be what is on line 1 (and esp column 19) of that file? A glance at the file on file exchange suggests the 19th character should be in the middle of the function name so clearly not a problem.

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 16 Mar 2017
Edited: John D'Errico on 16 Mar 2017
Unless you edited the code and inserted some garbage characters, then saved it...
What version of MATLAB do you have? What version did it say that it was written under?
Almost certainly, you have an old version of MATLAB. In order to use that code, you will need to use a more recent version.
The command ver will tell you what version you have.
help ver
  2 Comments
John D'Errico
John D'Errico on 16 Mar 2017
Ah. That happens. This is why it is generally advised not to edit code just to look at it. Too many windows open at once, certainly true on my machine. Too easy to insert random characters. And then too easy to accidentally save a file.
So always use the type command to look at a file.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!