Content of std.m file

2 views (last 30 days)
Mayank Lakhani
Mayank Lakhani on 5 Aug 2015
Commented: David Young on 6 Aug 2015
hi all,
I have datafun toolbox. However, by mistake i changed the code in std.m file(standard deviation). That would be good if anyone can tell me the content inside std.m file. thanks

Answers (1)

John D'Errico
John D'Errico on 5 Aug 2015
Edited: John D'Errico on 5 Aug 2015
And this is why I NEVER tell anyone to edit TMW provided code. Too many novices will edit the code and blow away provided code.
Editing provided code to look at it is a BAD IDEA. If you think you want to edit the code for std, think again. Then think about it a third time if necessary. There is no need to edit std.
Instead, use the type command if you just wish to look at the code.
To recover a toolbox function, just download that toolbox again from the website. You need not download all of MATLAB.
  6 Comments
dpb
dpb on 5 Aug 2015
I've always wondered why TMW didn't set the "read-only" bit but (at least on Windows) I don't think it ever has on installation. I surely don't recall ever having had it occur (and yes, while not a recommended practice, I have made bug fixes and enhancements on the distributed m-files since from the first installation I ever had() altho I am _*exceedingly_ careful to make backups of the originals prior to doing so and have never destroyed an original in the 25+ years).
I just checked and going back to R11, the earliest still-installed version here, and there are no m-files in the distribution that are write protected.
(*) I've also a text file that keeps track of which functions and what's been modified and a test suite or case to check whether the issue has been resolved in new releases on a new installation. Most all that were actual bugs have been; some of the enhancements may have done; some of those I've continued to carry along while others haven't bothered as the driving force behind them at the time often has gone away with the project at hand when it was an issue...the latter comes with retirement from active consulting, mostly. :)
David Young
David Young on 6 Aug 2015
The nice thing about the POPLOG editor, VED, was that you could give the command pved file.p (instead of the usual ved file.p) and it would start in a protected mode that prevented writing. You could therefore use it for any of your own code that you just wanted to inspect, as well as for POPLOG system files. Actually the system files were all write protected on installation as well, but using protected mode in the editor was tidier than falling back on file system protection. You could switch protected mode on and off from the editor as well.

Sign in to comment.

Categories

Find more on Install Products in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!