help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mex function online help text


From: David Bateman
Subject: Re: mex function online help text
Date: Thu, 1 Apr 2010 08:11:03 -0800 (PST)


Przemek Klosowski-7 wrote:
> 
> On 03/31/2010 03:23 PM, Dan McMahill wrote:
>> Hello,
>>
>> I'm using octave-3.2.4.  I have a compiled mex function which has been
>> installed to:
>> ${prefix}/libexec/octave/3.2.4/site/oct/i686-pc-linux-gnu/wcalc-1.1/
>> bars_calc.mex
>>
>> It works.  When I run octave, bars_calc() is available as a function
>> and does what I expect.
>>
>> However, the online help does not  work.
>>
>> octave-3.2.4:1>  help bars_calc
>> error: help: `bars_calc' is not documented
>>
>> yet I do have this file installed:
>> ${prefix}/libexec/octave/3.2.4/site/m/wcalc-1.1/bars_calc.m
> 
> I think that if you have a .m file and an .oct file, Octave
> just reads the .oct file and doesn't touch .m. You seem to believe
> that the doc subsystem reads the .m files anyway---maybe I missed
> something but I didn't think that's how it works. 
> 
> 

No, this is not the issue. The mex-interface includes no means to have a
help string in the source code of the function. This is true even in Matlab.
To include a help string you must have both a mex-file and a dot-m file with
the same basename. In that case the mex-file with be used as the function
and the dot-m file for the help string. Typically the dot-m has a small
function definition like

function varargout = bar_calc (varargin)
   error ("bar_calc: Not available");
end

as well so that you can be sure that your mex-file version of the code is
being used.

Cheers
David



-- 
View this message in context: 
http://n4.nabble.com/mex-function-online-help-text-tp1747273p1748277.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]