Graphics Programs Reference
Typing char(7) rings the bell.
Exercise 9 (Page 80)
The strvcat function is used instead of char because it ignores empty
strings in the input; the char function doesn't:
If char were used instead of strvcat , the result would always begin with
a blank line.
Exercise 10 (Page 83)
The problem is to deal with the two cases: (1) where the name of a
function or m-file is given, such as ' sin ', and (2) where the function itself
is given, such as ' sin(x) '. The difference here boils down to whether
the string input contains brackets or not (see hint). In other cases the
string input might not contain brackets, but would contain characters
used in defining a function, such as + , - , * , / ,or . (as in t.^2 ). The
ascii values for these characters are all less than 48, so we detect the
presence of a function (rather than a function name ) by checking the
input string for ascii values less than 48. If this is the case, we make
the input string into an inline function before passing it to feval :
% Simple function plotter.
% Test for characters whose presence would imply that f
% is a function (not a function name):
f = inline(f);