[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ending function in tests
From: |
Marco Atzeri |
Subject: |
ending function in tests |
Date: |
Thu, 21 May 2020 22:24:47 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Controlling the test results of odepkg
https://bitbucket.org/odepkg/odepkg/src/default/
with octave 5.2 on Cygwin I hit a strange error
***** end
!!!!! unknown test type!
the error is caused by ending functions with just "end"
%!function [ydot] = pendulum (vt, vy)
%! ydot = [0.5*vy(length(vy)/2+1:end);
-(2*5*9.806)*[zeros(length(vy)/4);ones(length(vy)/4)]];
%!end
of course replacing
%!end
with
%!endfunction
works, but also declaring a normal function with "end" works
function [ydot] = pendulum (vt, vy)
ydot = [0.5*vy(length(vy)/2+1:end);
-(2*5*9.806)*[zeros(length(vy)/4);ones(length(vy)/4)]];
end
as this maintain compatibility with Matlab.
Is this by design or should I open a bug ?
Regards
Marco
- ending function in tests,
Marco Atzeri <=