help-octave
[Top][All Lists]
Advanced

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

Re: How to wrap "lighting phong;" with a mock funtion?


From: Carlo de Falco
Subject: Re: How to wrap "lighting phong;" with a mock funtion?
Date: Mon, 14 May 2007 17:01:42 +0200


On 14/mag/07, at 16:32, David Bateman wrote:

Andreas Romeyke wrote:
Hello Carlo,

Carlo de Falco schrieb:
probably you can use mark_as_command:

The problem is, that mark_as_command only works outside of a function.
But I need it to define inside, because the testsuite is designed as
set of various functions.

If I try "mark_as_command" I got: warning: mark_as_command: invalid
use inside function body
and "iscommand lighting" returns 0 instead.

Do you have any additional hints?

Bye Andreas



evalin ('base', 'mark_as_command("lighting")')

D.

Andreas,
In the examples in your previous mail didn't you misplace some parentheses?

if ~exist('findobj'), dispatch('findobj',
strcat(pwd,'/octavefun/findobj.m', 'any')), end;

shouldn't this be:

if ~exist('findobj'), dispatch('findobj', strcat(pwd,'/octavefun/ findobj.m'), 'any'), end;

?

BTW, I thought you could simplify your code by taking advantage of the workings of the package manager:

define octavefun/fake_oct_fun.m:

function ret = fake_oct_fun(varargin)
ret = 1;
end

and put all of your dispatch commands in PKG_ADD,
you could do it in three lines this way:

missing_fun_list ={'findobj','gcf','gca'};
for ii=1:length
if ~exist(missing_fun_list{ii}), dispatch(missing_fun_list {ii},"fake_oct_fun",'any')), end;
end


when you add octavefun to your path octave will
execute the commands in PKG_ADD, while matlab will ignore it.
David, is this too much of a dirty trick?
Would it work at all?
c.








reply via email to

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