How to access subfunction headers with "help" command?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Marshall
el 14 de Nov. de 2014
Editada: per isakson
el 12 de En. de 2015
Hallo userbase,
for the following situation, is it possible to print the subfunction header to the command window using help?
function foo = myFunc(bar)
%MYFUNC
% A pointless function to demonstrate my question.
% @param <bar> input var
% @return <foo> output var
foo = mySubFunc(bar);
end % END myFunc
function foo = mySubFunc(bar)
%MYFUNC.MYSUBFUNC
% Here is some information about my very important and refactored subfunction.
foo = bar + bar;
end % END mySubFunc
If I punch in help myFunc :
>> help myFunc
myFunc
A pointless function to demonstrate my question.
@param <bar> input var
@return <foo> output var
But is there some way to access the subfunction header? Something like help myFunc.mySubFunc?
All the best, Marshall
0 comentarios
Respuesta aceptada
Adam
el 14 de Nov. de 2014
I'm fairly sure you can't. The subfunction is private to the file it is in so it has no outside visibility and shouldn't need it either since it cannot be called from outside of its parent file.
2 comentarios
Image Analyst
el 10 de En. de 2015
I guess you'd need to make it a comment for it to appear, just like the other comments appear:
% function foo = mySubFunc(bar)
Más respuestas (1)
per isakson
el 10 de En. de 2015
Editada: per isakson
el 12 de En. de 2015
"Something like help myFunc.mySubFunc?"   Yes, it's possible with R2013a (and earlier). Try
>> help cssm>sub_cssm
sub_cssm - subfunction of cssm
where
function cssm
end
function sub_cssm
% sub_cssm - subfunction of cssm
end
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!