Fix help text for newer MATLAB versions
1 view (last 30 days)
Show older comments
I've noticed a change in MATLAB's response to help text. We have equipment that, in the event of an error, automatically generates a trace of internal variables, and creates a MATLAB-formated file that includes help text identifying the machine name, firmware versions and timestamp of the error. We then have scripts that parse the help text and data to generate a human-readable report. We had been using R2010bSP1 for years, but when we updated we find the help() function returns differently. I've tested R2015b and R2016a, below is an example of the change:
data.m:
% Date: Tuesday, September 27, 2016 10:21:14 AM
% Arm B: 0.0.0.3
% Arm M: 2.1.15.8
% FPGA: 86.73.0.0
% Rows: 2048
24 865589 1141503331
25 865589 1112790400
26 865589 1143725291
27 865589 -1002890685
:
2010bSP1:
>> load 'data.m';
>> help('data.m')
Date: Tuesday, September 27, 2016 10:21:14 AM
Arm B: 0.0.0.3
Arm M: 2.1.15.8
FPGA: 86.73.0.0
Rows: 2048
>>
R2015b and R2016a:
>> load 'data.m';
>> help('data.m')
data is a variable of type doub.
>>
Would appreciate any suggestions on how to modify the help() function call to return the help text as before when using newer versions of MATLAB.
Thanks!
0 Comments
Accepted Answer
Steven Lord
on 28 Sep 2016
According to the Release Notes that was a deliberate change introduced in release R2015b. If you want to obtain help for a script or function but you have a variable with the same name in the workspace, the variable wins. The easiest solution is not to create variables with the same name as your script or function files.
More Answers (1)
Massimo Zanetti
on 28 Sep 2016
It seems you have a conflict with another file named "data". Try to supply the full path name to the help argument.
3 Comments
Massimo Zanetti
on 28 Sep 2016
I have R2015b and it works fine. The difference you notice happens when you invoke "help" with a Matlab variable argument. In this case the help provides you the type of the variable. If you invoke "help" with a function name, then it provides you the first commmented lines of the function. It works like this in ALL versions of Matlab.
See Also
Categories
Find more on Startup and Shutdown 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!