Prev: Simscape>Mechanical Source
Next: ezplot3 and hold bug?
From: Steven Lord on 1 Jun 2010 14:06 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message news:htrmdk$rcn$1(a)fred.mathworks.com... > "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message > <htrlad$im4$1(a)fred.mathworks.com>... > >> Then, as the first line of code in the file, add >> >> myMin=(a)min; > > Make that > > myMin=eval('@min'); %a deliberately horrible use of eval Or you can avoid EVAL: myMin = str2func('min'); Or you can force MATLAB to invoke the built-in MIN function: myMin = @(x) builtin('min', x); But the easiest way to avoid this problem is not to try to use an identifier as both a function and a variable. I understand it can be difficult to remember in a very long program whether you've used a particular identifier already. One solution to that is to avoid writing very long programs and instead to write functions that fit on one or two pages and invoke each function in turn. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Steven Lord on 1 Jun 2010 14:18
"Matt Fig" <spamanon(a)yahoo.com> wrote in message news:hts20o$vt$1(a)fred.mathworks.com... > It must be a slow day when a masking variable thread stays in the top 5 > for hours on end... Well, the fact that the original post in this thread was posted on the Saturday of a three-day holiday weekend in both the US (Memorial Day; see http://en.wikipedia.org/wiki/Memorial_Day) and the UK (Spring Bank Holiday; see http://en.wikipedia.org/wiki/Bank_holiday) may have something to do with that. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com |