<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Engineersphere.com &#187; MATLAB</title>
	<atom:link href="http://engineersphere.com/category/matlab/feed" rel="self" type="application/rss+xml" />
	<link>http://engineersphere.com</link>
	<description>doesn&#039;t have to make sense to you, but it&#039;s probably great for your health.</description>
	<lastBuildDate>Fri, 28 Oct 2011 03:05:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Welcome to Engineersphere&#8217;s MATLAB World!</title>
		<link>http://engineersphere.com/matlab/welcome-to-engineerspheres-matlab-world.html</link>
		<comments>http://engineersphere.com/matlab/welcome-to-engineerspheres-matlab-world.html#comments</comments>
		<pubDate>Tue, 14 Sep 2010 16:15:25 +0000</pubDate>
		<dc:creator>Javabean</dc:creator>
				<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[MATLAB Tutorial]]></category>
		<category><![CDATA[MATLAB Tutorial Series]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=1605</guid>
		<description><![CDATA[TweetTweetThis series of articles contains information and tutorials for any Matlab User.  These tutorials and guides are written with the assumption that the user has no previous knowledge of linear algebra or Matlab.  Each tutorial is broken into 4 sections and structured in the following way. Blue: Section 1: Background and tutorial of the math [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/welcome-to-engineerspheres-matlab-world.html&via=EngineerSphere&text=Welcome to Engineersphere's MATLAB World!&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/welcome-to-engineerspheres-matlab-world.html&via=EngineerSphere&text=Welcome to Engineersphere's MATLAB World!&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>This series of articles contains information and tutorials for any Matlab User.  These tutorials and guides are written with the assumption that the user has no previous knowledge of linear algebra or Matlab.  Each tutorial is broken into 4 sections and structured in the following way.</p>
<p>Blue: Section 1: Background and tutorial of the math and linear algebra that is used.</p>
<p>Green: Section 2: The MATLAB tutorial.</p>
<p>Orange: Section 3: Examples.</p>
<p>Red Section 4: Problems and learning exercises.</p>
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/matlab/welcome-to-engineerspheres-matlab-world.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Linear Algebra: Defining Vectors and Matrices</title>
		<link>http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html</link>
		<comments>http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html#comments</comments>
		<pubDate>Tue, 14 Sep 2010 06:45:46 +0000</pubDate>
		<dc:creator>Javabean</dc:creator>
				<category><![CDATA[MATLAB Lesson #1]]></category>
		<category><![CDATA[Linear Algebra]]></category>
		<category><![CDATA[MATLAB Tutorial]]></category>
		<category><![CDATA[Matrices]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=1608</guid>
		<description><![CDATA[TweetTweetVectors and Matrices what are they? In Matlab everything is defined as either a vector or a matrix therefore it is imperative that you know what Vectors and Matrices are before you begin using Matlab.  The formal definition of a vector is something that has both a direction and a velocity. When using Matlab however, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html&via=EngineerSphere&text=Basic Linear Algebra: Defining Vectors and Matrices&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html&via=EngineerSphere&text=Basic Linear Algebra: Defining Vectors and Matrices&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><h2><span style="color: #0000ff;">Vectors and Matrices what are they?</span></h2>
<p><span style="color: #333333;">In Matlab everything is defined as either a vector or a matrix therefore it is imperative that you know what Vectors and Matrices are before you begin using Matlab.  The formal definition of a vector is something that has both a direction and a velocity. When using Matlab however, I think it is easier to think of a vector as either a row or a column of values. These values can be names, numbers, or anything you want. There are two kinds of vectors. These are row vectors and column vectors.</span></p>
<p>A Row Vector is a vector which has only <strong>One</strong> <strong>Row</strong> <span style="color: #000000;">and can have as many columns as one wants. A row vector V with n columns is shown below.</span></p>
<p><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/row_vector.gif"><span style="color: #000000;"> </span></a></span><a href="http://engineersphere.com/wp-content/uploads/2010/09/row_vector.gif"><span style="color: #000000;"> </span></a><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/row_vector.gif"><br />
</a></span></p>
<p><span style="color: #000000;"> </span></p>
<p>&nbsp;</p>
<p><span style="color: #000000;">Alternatively, a column vector is a vector which has only <strong>ONE Column</strong> and can have as many rows as one wants. A column vector V with m rows is shown below.</span></p>
<p><a rel="attachment wp-att-1780" href="http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html/attachment/column_vector"><img class="alignnone size-full wp-image-1780" title="column-vector" src="http://engineersphere.com/wp-content/uploads/2010/09/column_vector.gif" alt="column-vector" width="200" height="170" /></a></p>
<h2><span style="color: #000000;">Matrices</span></h2>
<p><span style="color: #000000;">A matrix is a rectangular array of quantities or expressions. I prefer to think of them as 2-D vectors. Matrices have both numerous rows and columns.</span></p>
<p><span style="color: #000000;">The typical representation of a matrix is m x n meaning the matrix has m rows and n columns.</span></p>
<p><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/Matrix2.gif"><img class="alignnone size-full wp-image-1760" title="matrix" src="http://engineersphere.com/wp-content/uploads/2010/09/Matrix2.gif" alt="matrix" width="230" height="97" /></a></span></p>
<p><span style="color: #000000;">The subscripts of each element refer to its position in the matrix. Matrices come in all different sizes and shapes. A matrix who has the same number of rows as columns is called a <strong>Square Matrix</strong></span>.</p>
<h2><span style="color: #008000;">H</span><span style="color: #008000;">ow to define Vectors and Matrices in MATLAB<br />
</span></h2>
<h3><span style="color: #008000;"><span style="color: #000000;">Row Vectors</span></span></h3>
<p><span style="color: #008000;"><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/row_vector_description.gif"></a><a href="http://engineersphere.com/wp-content/uploads/2010/09/row_vector_description2.gif"><img class="alignnone size-full wp-image-1772" title="row-vector-description" src="http://engineersphere.com/wp-content/uploads/2010/09/row_vector_description2.gif" alt="row-vector-description" width="664" height="132" /></a><br />
</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;">The use of the semicolon at the end of each line ensures that Matlab will not print off the value of V in the Command Window. <strong>If you wish to have it display this value when running, remove the semicolon</strong>.</span></span></p>
<h3><span style="color: #008000;"><span style="color: #000000;">Column Vectors</span></span></h3>
<p><span style="color: #008000;"><span style="color: #000000;">When defining column vectors in Matlab use the semicolon (;) to separate rows.</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/column_vector_description.gif"><img class="alignnone size-full wp-image-1773" title="column-vector-description" src="http://engineersphere.com/wp-content/uploads/2010/09/column_vector_description.gif" alt="column-vector-description" width="669" height="186" /></a></span></span></p>
<h3><span style="color: #008000;"><span style="color: #000000;">Accessing Different Vector Indices</span></span></h3>
<p><span style="color: #008000;"><span style="color: #000000;">To access different indices in a vector the following notation is used.</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;">To access the third index or the value of 7 in both of the vector examples above one uses V(3). This tells Matlab that you are referencing the third value in the vector V.</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;">Lets say you wish to multiply the third and fourth entry of the vector V and store that value in the first entry. You would type</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;">V(1)=V(3)*V(4)</span></span></p>
<h3><span style="color: #008000;"><span style="color: #000000;">Matrices</span></span></h3>
<p><span style="color: #008000;"><span style="color: #000000;">Matrices in Matlab are defined by combining both row and column vectors. A 3 by 3 matrix in Matlab would be defined as follows.</span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/matrix_Matlab.gif"><img class="alignnone size-full wp-image-1777" title="matrix-matlab" src="http://engineersphere.com/wp-content/uploads/2010/09/matrix_Matlab.gif" alt="matrix-matlab" width="670" height="148" /></a><br />
</span></span></p>
<h2><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;">MATLAB Examples</span></span></span></h2>
<p><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">1) Define a 4 element row vector and then replace the third element by the product of the first and fourth.</span></span></span></span></p>
<p><a href="http://engineersphere.com/wp-content/uploads/2010/09/vector_example1.gif"><img class="alignnone size-full wp-image-1801" title="vector-example1" src="http://engineersphere.com/wp-content/uploads/2010/09/vector_example1.gif" alt="vector-example1" width="647" height="98" /></a></p>
<p><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">2) Define a 3 element column vector and then put the value of 5 into the second element.</span></span></span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/vector_example2.gif"><img class="alignnone size-full wp-image-1802" title="vector-example2" src="http://engineersphere.com/wp-content/uploads/2010/09/vector_example2.gif" alt="vector-example2" width="648" height="103" /></a><br />
</span></span></span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;">3) Define a 4by5 matrix and then make it so when you run the Matlab script, the element in the 3rd row and 2nd column will be printed.</span></span></span></span></p>
<p><span style="color: #008000;"><span style="color: #000000;"><span style="color: #ff0000;"><span style="color: #000000;"><a href="http://engineersphere.com/wp-content/uploads/2010/09/matrix_example.gif"><img class="alignnone size-full wp-image-1803" title="matrix-example" src="http://engineersphere.com/wp-content/uploads/2010/09/matrix_example.gif" alt="matrix-example" width="667" height="114" /></a></span></span></span></span></p>
<h2><span style="color: #ff6600;">Practice Problems</span></h2>
<p><span style="color: #000000;">1) Define a 3 by 2 matrix and replace the value on the second row second column with the value on the third row first column.</span></p>
<p><span style="color: #000000;">2) Define a row vector with 6 elements.</span></p>
<p><span style="color: #000000;">3) Define a column vector with 2 elements and make sure they both print when you run Matlab (Hint: semicolon)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/matlab/matlab-lesson-1/basic-linear-algebra-defining-vectors-and-matrices.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Root Locus Method in MATLAB</title>
		<link>http://engineersphere.com/matlab/root-locus-method-in-matlab.html</link>
		<comments>http://engineersphere.com/matlab/root-locus-method-in-matlab.html#comments</comments>
		<pubDate>Tue, 13 Oct 2009 15:43:19 +0000</pubDate>
		<dc:creator>Papa_Smurf</dc:creator>
				<category><![CDATA[Control Systems]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Root Locus]]></category>
		<category><![CDATA[root locus matlab]]></category>
		<category><![CDATA[root locus method]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=1025</guid>
		<description><![CDATA[TweetTweetTo start out, setup the open loop transfer function. Next, you can choose to set up the MATLAB code in a few different ways. First make sure that both the numerator and denominator are in acceptable forms. [1 2 3] is the same as saying Using an example: We can write the numerator and denominator MATLAB codes as: &#62;&#62;numerator=[1]; [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/root-locus-method-in-matlab.html&via=EngineerSphere&text=Root Locus Method in MATLAB&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/matlab/root-locus-method-in-matlab.html&via=EngineerSphere&text=Root Locus Method in MATLAB&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>To start out, setup the open loop transfer function.</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=G%28s%29H%28s%29%20%3D%20%5Cfrac%7BK%2A%28numerator%29%7D%7B%28denominator%29%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='G(s)H(s) = \frac{K*(numerator)}{(denominator)} ' title='G(s)H(s) = \frac{K*(numerator)}{(denominator)} ' class='latex' /></p>
<p>Next, you can choose to set up the MATLAB code in a few different ways. First make sure that both the numerator and denominator are in acceptable forms.</p>
<p style="text-align: center;">[1 2 3] is the same as saying <img src='http://s.wordpress.com/latex.php?latex=s%5E%7B2%7D%2B2s%2B3%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='s^{2}+2s+3 ' title='s^{2}+2s+3 ' class='latex' /></p>
<p>Using an example:</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=G%28s%29H%28s%29%20%3D%20%5Cfrac%7BK%7D%7B%28s%2B8%29%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='G(s)H(s) = \frac{K}{(s+8)} ' title='G(s)H(s) = \frac{K}{(s+8)} ' class='latex' /></p>
<p>We can write the numerator and denominator MATLAB codes as:</p>
<p>&gt;&gt;numerator=[1];</p>
<p>&gt;&gt;denominator=[1 8];</p>
<p>For a more complex problem we can bypass the long and tedious expansion process and use the convolution function in MATLAB.</p>
<p style="text-align: center;"><img src='http://s.wordpress.com/latex.php?latex=G%28s%29H%28s%29%3D%5Cfrac%7BK%7D%7B%28s%2B1%29%28s%5E2%2B6s%2B18%29%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='G(s)H(s)=\frac{K}{(s+1)(s^2+6s+18)} ' title='G(s)H(s)=\frac{K}{(s+1)(s^2+6s+18)} ' class='latex' /></p>
<p style="text-align: left;">Here, the denominator is also represented by (s+1)*(s+3+3j)*(s+3-3j). Being three seperate parts, we can use convolution once for two of them, then use convolution again with the remaining part. Just look at the example:</p>
<p style="text-align: center;">conv( A , conv( B , C ) )  &#8212;&gt; denominator = conv( [1 1], conv( [1 3+3*j], [1 3-3*j] ) );</p>
<p style="text-align: left;">After we define our numerator and denominator in MATLAB, we can use the root locus function then set our axis parameters as follows.</p>
<p style="text-align: center;">&gt;&gt;rlocus( numerator, denominator )</p>
<p style="text-align: center;">&gt;&gt;axis([-10 10 -10 10])</p>
<p>Your plot should look similar to the following for this example:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1039" title="root-locus-plot" src="http://engineersphere.com/wp-content/uploads/2009/10/rootlocus1.jpg" alt="root-locus-plot" width="560" height="420" /></p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/matlab/root-locus-method-in-matlab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vector Dot Product</title>
		<link>http://engineersphere.com/math/calculus/vector-dot-product.html</link>
		<comments>http://engineersphere.com/math/calculus/vector-dot-product.html#comments</comments>
		<pubDate>Tue, 08 Sep 2009 05:29:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Calculus]]></category>
		<category><![CDATA[Electromagnetic Theory]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Statics]]></category>
		<category><![CDATA[dot product]]></category>
		<category><![CDATA[dot product angle]]></category>
		<category><![CDATA[find dot product]]></category>
		<category><![CDATA[vector angle]]></category>
		<category><![CDATA[vector dot product]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=800</guid>
		<description><![CDATA[TweetTweetVector dot product rules Another simple review of the vector dot product, for those of you that have forgotten.  The operation that involves multiplying two vectors together can be done in a few ways.  The first operation is called either the scalar product or the dot product.  One of the well known definitions looks like [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/vector-dot-product.html&via=EngineerSphere&text=Vector Dot Product&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/vector-dot-product.html&via=EngineerSphere&text=Vector Dot Product&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><h3>Vector dot product rules</h3>
<p>Another simple review of the vector dot product, for those of you that have forgotten.  The operation that involves multiplying two vectors together can be done in a few ways.  The first operation is called either the scalar product or the dot product.  One of the well known definitions looks like this:</p>
<p>RULE 1: <img src='http://s.wordpress.com/latex.php?latex=A%20%5Ccdot%20B%20%5Cequiv%20%7CA%7C%7CB%7Ccos%28%5CTheta%29%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A \cdot B \equiv |A||B|cos(\Theta) ' title='A \cdot B \equiv |A||B|cos(\Theta) ' class='latex' /></p>
<p>This is a scalar product that is equal to the two magnitudes multiplied together and multiplied by the cosine of the angle between them.  If  the two vectors are perpendicular to each other then the angle between them is 90 degrees, which will make the dot product equal zero.  This is an equivalent equation.</p>
<p>RULE 2: <img src='http://s.wordpress.com/latex.php?latex=A%20%5Ccdot%20B%20%5Cequiv%20A_%7Bx%7DB_%7Bx%7D%20%2B%20A_%7By%7DB_%7By%7D%20%2B%20A_%7Bz%7DB_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A \cdot B \equiv A_{x}B_{x} + A_{y}B_{y} + A_{z}B_{z} ' title='A \cdot B \equiv A_{x}B_{x} + A_{y}B_{y} + A_{z}B_{z} ' class='latex' /></p>
<p>When you finish your dot product, you should have a number, not a directional vector.  So if you get something like this you did something wrong: <img src='http://s.wordpress.com/latex.php?latex=3%20u_%7Bx%7D%20%2B%202%20u_%7By%7D%20-%205%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='3 u_{x} + 2 u_{y} - 5 u_{z} ' title='3 u_{x} + 2 u_{y} - 5 u_{z} ' class='latex' />.  If you ended up with <img src='http://s.wordpress.com/latex.php?latex=A%20%5Ccdot%20B%20%3D%2035%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A \cdot B = 35 ' title='A \cdot B = 35 ' class='latex' /> (any #) then you don&#8217;t have to completely rule out your answer.</p>
<h3>Practice vectors</h3>
<p>A few vectors to practice with:</p>
<p><img src='http://s.wordpress.com/latex.php?latex=A%20%3D%202%20u_%7Bx%7D%20-%203%20u_%7By%7D%20%2B%205%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A = 2 u_{x} - 3 u_{y} + 5 u_{z} ' title='A = 2 u_{x} - 3 u_{y} + 5 u_{z} ' class='latex' /></p>
<p><img src='http://s.wordpress.com/latex.php?latex=B%20%3D%20u_%7Bx%7D%20-%202%20u_%7By%7D%20%2B%202%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='B = u_{x} - 2 u_{y} + 2 u_{z} ' title='B = u_{x} - 2 u_{y} + 2 u_{z} ' class='latex' /></p>
<p><img src='http://s.wordpress.com/latex.php?latex=%7CA%7C%20%3D%20%5Csqrt%7B%282%29%5E%7B2%7D%20%2B%20%28-3%29%5E%7B2%7D%20%2B%20%285%29%5E%7B2%7D%7D%20%3D%20%5Csqrt%7B38%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='|A| = \sqrt{(2)^{2} + (-3)^{2} + (5)^{2}} = \sqrt{38} ' title='|A| = \sqrt{(2)^{2} + (-3)^{2} + (5)^{2}} = \sqrt{38} ' class='latex' /></p>
<p><img src='http://s.wordpress.com/latex.php?latex=%7CB%7C%20%3D%20%5Csqrt%7B%281%29%5E%7B2%7D%20%2B%20%28-2%29%5E%7B2%7D%20%2B%20%282%29%5E%7B2%7D%7D%20%3D%203%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='|B| = \sqrt{(1)^{2} + (-2)^{2} + (2)^{2}} = 3 ' title='|B| = \sqrt{(1)^{2} + (-2)^{2} + (2)^{2}} = 3 ' class='latex' /></p>
<p><img src='http://s.wordpress.com/latex.php?latex=A%20%5Ccdot%20B%20%3D%20%282%29%281%29%20%2B%20%28-3%29%28-2%29%20%2B%20%285%29%282%29%20%3D%2018%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A \cdot B = (2)(1) + (-3)(-2) + (5)(2) = 18 ' title='A \cdot B = (2)(1) + (-3)(-2) + (5)(2) = 18 ' class='latex' /></p>
<p>Okay, now we have found our dot product by applying RULE 2 above.  We can use this value along with our individual vector magnitudes to apply RULE 1 and obtain the angle <img src='http://s.wordpress.com/latex.php?latex=%5CTheta%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='\Theta ' title='\Theta ' class='latex' />.</p>
<p><img src='http://s.wordpress.com/latex.php?latex=%5CTheta%20%3D%20%5Carccos%28%5Cfrac%7BA%20%5Ccdot%20B%7D%7B%7CA%7C%7CB%7C%7D%29%20%3D%2018.26%20%5Ccdot%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='\Theta = \arccos(\frac{A \cdot B}{|A||B|}) = 18.26 \cdot ' title='\Theta = \arccos(\frac{A \cdot B}{|A||B|}) = 18.26 \cdot ' class='latex' /></p>
<p>We can calculate the projection of the vector A onto the vector B by this relationship:</p>
<p><img src='http://s.wordpress.com/latex.php?latex=proj_%7BB%7D%20A%20%3D%20%5Cfrac%7BA%20%5Ccdot%20B%7D%7B%7CB%7C%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='proj_{B} A = \frac{A \cdot B}{|B|} ' title='proj_{B} A = \frac{A \cdot B}{|B|} ' class='latex' /></p>
<p>Note that this is a scalar quantity, and that we can also define the projection of B onto vector A in a similar fashion:</p>
<p><img src='http://s.wordpress.com/latex.php?latex=proj_%7BA%7D%20B%20%3D%20%5Cfrac%7BA%20%5Ccdot%20B%7D%7B%7CA%7C%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='proj_{A} B = \frac{A \cdot B}{|A|} ' title='proj_{A} B = \frac{A \cdot B}{|A|} ' class='latex' /></p>
<h3>Performing a vector dot product in MATLAB</h3>
<p>Perform a dot product in MATLAB like so:</p>
<p>&gt;&gt;A = [ 1 2 3];</p>
<p>&gt;&gt;B = [2 3 4];</p>
<p>&gt;&gt;dot(A,B)</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/math/calculus/vector-dot-product.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding and Subtracting Vectors</title>
		<link>http://engineersphere.com/math/calculus/adding-and-subtracting-vectors.html</link>
		<comments>http://engineersphere.com/math/calculus/adding-and-subtracting-vectors.html#comments</comments>
		<pubDate>Tue, 08 Sep 2009 04:54:59 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Calculus]]></category>
		<category><![CDATA[Dynamics]]></category>
		<category><![CDATA[Electromagnetic Theory]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Statics]]></category>
		<category><![CDATA[adding vectors]]></category>
		<category><![CDATA[subtracting vectors]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=797</guid>
		<description><![CDATA[TweetTweetThis is a very simple post and a very simple subject, but every once in a while even the experts need to be reminded how to do simple addition and subtraction with vectors.  Let&#8217;s go ahead and specify a couple vectors that we can work with. Vector In MATLAB: &#62;&#62;A = [1 2 4]; Vector [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/adding-and-subtracting-vectors.html&via=EngineerSphere&text=Adding and Subtracting Vectors&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/adding-and-subtracting-vectors.html&via=EngineerSphere&text=Adding and Subtracting Vectors&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>This is a very simple post and a very simple subject, but every once in a while even the experts need to be reminded how to do simple addition and subtraction with vectors.  Let&#8217;s go ahead and specify a couple vectors that we can work with.</p>
<p>Vector <img src='http://s.wordpress.com/latex.php?latex=A%20%3D%20u_%7Bx%7D%20%2B%202%20u_%7By%7D%20%2B%203%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='A = u_{x} + 2 u_{y} + 3 u_{z} ' title='A = u_{x} + 2 u_{y} + 3 u_{z} ' class='latex' /></p>
<p>In MATLAB: &gt;&gt;A = [1 2 4];</p>
<p>Vector <img src='http://s.wordpress.com/latex.php?latex=B%20%3D%202%20u_%7Bx%7D%20%2B%203%20u_%7By%7D%20%2B%204%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='B = 2 u_{x} + 3 u_{y} + 4 u_{z} ' title='B = 2 u_{x} + 3 u_{y} + 4 u_{z} ' class='latex' /></p>
<p>In MATLAB: &gt;&gt;B = [2 3 4];</p>
<p>When you add vectors together, you add each individual directional component (<img src='http://s.wordpress.com/latex.php?latex=u_%7Bx%7D%2C%20u_%7By%7D%2C%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='u_{x}, u_{y}, u_{z} ' title='u_{x}, u_{y}, u_{z} ' class='latex' />).  Subtraction works the exact same way.  Lets go ahead and do a few, C will represent the vector that results from the addition and subtraction.</p>
<p><img src='http://s.wordpress.com/latex.php?latex=C%20%3D%20A%20%2B%20B%20%3D%20%282%20%2B%201%29%20u_%7Bx%7D%20%2B%20%282%20%2B%203%29%20u_%7By%7D%20%2B%20%283%20%2B%204%29%20u_%7Bz%7D%20%3D%203%20u_%7Bx%7D%20%2B%205%20u_%7By%7D%20%2B%207%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='C = A + B = (2 + 1) u_{x} + (2 + 3) u_{y} + (3 + 4) u_{z} = 3 u_{x} + 5 u_{y} + 7 u_{z} ' title='C = A + B = (2 + 1) u_{x} + (2 + 3) u_{y} + (3 + 4) u_{z} = 3 u_{x} + 5 u_{y} + 7 u_{z} ' class='latex' /></p>
<p><img src='http://s.wordpress.com/latex.php?latex=C%20%3D%20A%20-%20B%20%3D%20%282%20-%201%29%20u_%7Bx%7D%20%2B%20%282%20-%203%29%20u_%7By%7D%20%2B%20%283%20-%204%29%20u_%7Bz%7D%20%3D%20u_%7Bx%7D%20-%20u_%7By%7D%20-%20u_%7Bz%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='C = A - B = (2 - 1) u_{x} + (2 - 3) u_{y} + (3 - 4) u_{z} = u_{x} - u_{y} - u_{z} ' title='C = A - B = (2 - 1) u_{x} + (2 - 3) u_{y} + (3 - 4) u_{z} = u_{x} - u_{y} - u_{z} ' class='latex' /></p>
<p>These vectors are all in 3-dimensional space with a X, Y and Z component.  The number in front of each <img src='http://s.wordpress.com/latex.php?latex=u_%7B..%7D%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='u_{..} ' title='u_{..} ' class='latex' /> directional component is the weight or magnitude of that particular directional component of the vector.  There it is, short and sweet <img src='http://engineersphere.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/math/calculus/adding-and-subtracting-vectors.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Volume of Ellipsoid &#8211; MATLAB</title>
		<link>http://engineersphere.com/math/calculus/volume-of-ellipsoid-matlab.html</link>
		<comments>http://engineersphere.com/math/calculus/volume-of-ellipsoid-matlab.html#comments</comments>
		<pubDate>Mon, 31 Aug 2009 02:28:47 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Calculus]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Elipsoid]]></category>
		<category><![CDATA[Ellipsoid]]></category>
		<category><![CDATA[Ellipsoid Volume]]></category>
		<category><![CDATA[Volume of Ellipsoid]]></category>

		<guid isPermaLink="false">http://engineersphere.com/?p=729</guid>
		<description><![CDATA[TweetTweetThis is how you calculate the volume of an ellipsoid with the following equation. rmax = 1; V = 0; step = 0.02; A = 5; B = 10; C = 15; for x= -5 : step : 5 for y = -10 : step : 10 for z = -15 : step : 15 [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/volume-of-ellipsoid-matlab.html&via=EngineerSphere&text=Volume of Ellipsoid - MATLAB&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://engineersphere.com/math/calculus/volume-of-ellipsoid-matlab.html&via=EngineerSphere&text=Volume of Ellipsoid - MATLAB&related=EngineerSphere:&lang=en&count=none" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><p>This is how you calculate the volume of an ellipsoid with the following equation.</p>
<p><img src='http://s.wordpress.com/latex.php?latex=x%5E%7B2%7D%2B%20%5Cfrac%7B1%7D%7B4%7D%20y%5E%7B2%7D%20%2B%20%5Cfrac%7B1%7D%7B9%7D%20z%5E%7B2%7D%20%5Cle%2025%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='x^{2}+ \frac{1}{4} y^{2} + \frac{1}{9} z^{2} \le 25 ' title='x^{2}+ \frac{1}{4} y^{2} + \frac{1}{9} z^{2} \le 25 ' class='latex' /></p>
<p>rmax = 1;<br />
V = 0;<br />
step = 0.02;<br />
A = 5;</p>
<p>B = 10;<br />
C = 15;<br />
for x= -5 : step : 5<br />
for y = -10 : step : 10<br />
for z = -15 : step : 15<br />
if((x/A).^2 + (y/B).^2 + (z/C).^2) &lt; rmax<br />
V = V + step.^3;<br />
end<br />
end<br />
end<br />
end<br />
disp(V)</p>
<p>it should spit out <img src='http://s.wordpress.com/latex.php?latex=1000%20%5Cpi%20&#038;bg=efe5d9&#038;fg=000000&#038;s=0' alt='1000 \pi ' title='1000 \pi ' class='latex' />, approximately</p>
]]></content:encoded>
			<wfw:commentRss>http://engineersphere.com/math/calculus/volume-of-ellipsoid-matlab.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

