Thread View: comp.soft-sys.matlab
1 messages
1 total messages
Started by Michael Maurer
Sat, 23 Jan 1993 01:00
SOURCE: vfeval.m - feval with extra arguments
Author: Michael Maurer
Date: Sat, 23 Jan 1993 01:00
Date: Sat, 23 Jan 1993 01:00
53 lines
2003 bytes
2003 bytes
Hoping to start a trend, here is an unsolicited matlab m-file.
VFEVAL is like FEVAL but allows extra arguments.
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# vfeval.m
# This archive created: Fri Jan 22 16:56:12 1993
export PATH; PATH=/bin:$PATH
echo shar: extracting "'vfeval.m'" '(547 characters)'
if test -f 'vfeval.m'
then
echo shar: will not over-write existing file "'vfeval.m'"
else
sed 's/^XX//' << \SHAR_EOF > 'vfeval.m'
XXfunction y=vfeval(fun,P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)
XX
XX%VFEVAL
XX% y=vfeval(fun,P1,...). Like FEVAL, but allows up to 10 extra
XX% arguments named P1,P2,...,P10.
XX% Example:
XX% y = vfeval('2*sin(P1+P2)',a,b)
XX
XX% See FMIN.M for inspiration.
XX% Michael Maurer, 10 Feb 1992.
XX% Copyright (c) 1993 by Michael Maurer
XX
XXif any(fun<48),
XX evalstr=fun;
XXelse
XX evalstr=[fun, '('];
XX for argc=1:nargin - 1
XX if argc>1,
XX evalstr=[evalstr ','];
XX end
XX evalstr = [evalstr,'P',num2str(argc)];
XX end
XX evalstr = [evalstr, ')'];
XXend
XXy=eval(evalstr);
SHAR_EOF
if test 547 -ne "`wc -c < 'vfeval.m'`"
then
echo shar: error transmitting "'vfeval.m'" '(should have been 547 characters)'
fi
fi # end of overwriting check
# End of shell archive
exit 0
--
______________________________________________________________________
Michael Maurer maurer@nova.stanford.edu (415) 723-1024
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads