Defines | |
#define | new functions inside a demo. Instead you will have to |
Functions | |
function | demo (name, n) if(nargin< 1||nargin > 2) print_usage() |
endif | if (nargin< 2) n=0 |
if (length(idx)==0) warning("demo not available for %s" | |
elseif (n >=length(idx)) warning("only %d demos available for %s" | |
length (idx)-1 | |
endif | if (n > 0) doidx |
eval (cstrcat("function __demo__()\n", block,"\nendfunction")) | |
printf ("%s example %d:%s\n\n", name, doidx(i), block) | |
catch | printf ("%s example %d: failed\n%s", name, doidx(i), __error_text__) |
Variables | |
endif [code, idx] = test (name, "grabdemo") | |
name | |
return | |
else | doidx = 1:length(idx)-1 |
endif for | i |
endif try | block = code(idx(doidx(i)):idx(doidx(i)+1)-1) |
__demo__ | |
endfor endfunction!demo | !t = 0:0.01:2*pi |
x = sin(t) |
elseif | ( | n >= | lengthidx | ) |
eval | ( | cstrcat("function __demo__()\n", block,"\nendfunction") | ) |
endif if | ( | n | , | |
0 | ||||
) |
if | ( | length(idx) | = = 0 |
) |
endif if | ( | ) | [pure virtual] |
length | ( | idx | ) |
endfor endfunction !demo !t = 0:0.01:2*pi |
end_try_catch clear __demo__ |
return |
x = sin(t) |