Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property LoadBalancer::$mWriteIndex is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/LoadBalancer.php on line 83
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Return type of ResultWrapper::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 174
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Return type of ResultWrapper::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 192
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Return type of ResultWrapper::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 185
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Return type of ResultWrapper::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 202
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Return type of ResultWrapper::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 163
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property WikitextContentHandler::$mModelName is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/content/ContentHandler.php on line 416
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property RequestContext::$recursion is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/context/RequestContext.php on line 332
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property MessageCache::$mMemc is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/cache/MessageCache.php on line 136
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property LoadBalancer::$mWriteIndex is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/LoadBalancer.php on line 83
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Parser::$mPreprocessorClass is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/parser/Parser.php on line 255
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/parser/Preprocessor_DOM.php on line 778
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php:344) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Feed.php on line 234
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php:344) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php:344) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php:344) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php:344) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37 https://rave.gatech.edu/help/index.php?action=history&feed=atom&title=Vectorized_functionsVectorized functions - Revision history2025-12-14T16:14:08ZRevision history for this page on the wikiMediaWiki 1.25.5 Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/content/TextContent.php on line 56
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/content/TextContent.php on line 56
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property BufferingStatsdDataFactory::$prefix is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/libs/BufferingStatsdDataFactory.php on line 38 https://rave.gatech.edu/help/index.php?title=Vectorized_functions&diff=3331&oldid=prevAdmin at 13:20, 23 August 20132013-08-23T13:20:22Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 13:20, 23 August 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L8" >Line 8:</td>
<td colspan="2" class="diff-lineno">Line 8:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* ^ with .^</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>* ^ with .^</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The . in front of these operators tells MATLAB to apply the operator to each element of the array instead of treating the array like a matrix and using matrix math operations. Note that the + and - operators do not require a .<del class="diffchange diffchange-inline">, </del>since matrix addition and subtraction already operates on each element individually. Similarly, most other built-in MATLAB functions do not require special vectorization. Examples include exp(), log(), and all the trig functions.</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The . in front of these operators tells MATLAB to apply the operator to each element of the array instead of treating the array like a matrix and using matrix math operations. Note that the + and - operators do not require a . since matrix addition and subtraction already operates on each element individually. Similarly, most other built-in MATLAB functions do not require special vectorization. Examples include exp(), log(), and all the trig functions.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For example, the function y = sin(x1)*x2^2 would be coded in MATLAB as y = sin(x1).*x2.^2</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>For example, the function y = sin(x1)*x2^2 would be coded in MATLAB as y = sin(x1).*x2.^2</div></td></tr>
</table>Admin Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property Revision::$mUnpatrolled is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/Revision.php on line 707
Deprecated: Creation of dynamic property ErrorException::$_mwLogId is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/exception/MWExceptionHandler.php on line 344
Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/content/TextContent.php on line 56 https://rave.gatech.edu/help/index.php?title=Vectorized_functions&diff=3330&oldid=prevAdmin: Created page with "A '''vectorized function''' is a basic MATLAB coding concept. It refers to a function that operates on each element of an array independently, rather than treating the array a..."2013-08-23T13:19:59Z<p>Created page with "A '''vectorized function''' is a basic MATLAB coding concept. It refers to a function that operates on each element of an array independently, rather than treating the array a..."</p>
<p><b>New page</b></p><div>A '''vectorized function''' is a basic MATLAB coding concept. It refers to a function that operates on each element of an array independently, rather than treating the array as a matrix and using matrix math. <br />
<br />
All user-supplied function in Rave must be vectorized. When Rave needs to evaluate multiple points using your functions, it sends all of those points to your function as an array in which each row of the array represents one point to be evaluated. <br />
<br />
Vectorizing a simple function in MATLAB usually entails replacing:<br />
* * with .* <br />
* / with ./ <br />
* ^ with .^<br />
<br />
The . in front of these operators tells MATLAB to apply the operator to each element of the array instead of treating the array like a matrix and using matrix math operations. Note that the + and - operators do not require a ., since matrix addition and subtraction already operates on each element individually. Similarly, most other built-in MATLAB functions do not require special vectorization. Examples include exp(), log(), and all the trig functions.<br />
<br />
For example, the function y = sin(x1)*x2^2 would be coded in MATLAB as y = sin(x1).*x2.^2<br />
<br />
<br />
See the [http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html MATLAB Documentation] for more details.</div>Admin