<?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>MathLab Archives - Tutorial45</title>
	<atom:link href="https://tutorial45.com/category/mathlab/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tutorials and Tech</description>
	<lastBuildDate>Sun, 02 Aug 2020 14:24:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://tutorial45.com/wp-content/uploads/2015/04/cropped-text125d52-32x32.png</url>
	<title>MathLab Archives - Tutorial45</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Conditional Plotting in Matlab</title>
		<link>https://tutorial45.com/conditional-plotting-in-matlab/</link>
					<comments>https://tutorial45.com/conditional-plotting-in-matlab/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 16:45:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=2273</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/conditional-plotting-in-matlab/">Conditional Plotting in Matlab</a></p>
<p>By now, you should have learned the basics of plotting in Matlab using previous post. In this session we want to look closer to how we can plot a conditional plot using Matlab Here is an easy example of a conditional plot plot f Conditional plotting in Matlab One of the way you can walk ... </p>
<p class="read-more-container"><a title="Conditional Plotting in Matlab" class="read-more button" href="https://tutorial45.com/conditional-plotting-in-matlab/#more-2273" aria-label="More on Conditional Plotting in Matlab">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/conditional-plotting-in-matlab/">Conditional Plotting in Matlab</a></p>

<p class="wp-block-paragraph">By now, you should have learned the <a href="http://tutorial45.com/plotting-in-matlab/">basics of plotting in Matlab</a> using previous post. In this session we want to look closer to how we can plot a conditional plot using Matlab Here is an easy example of a conditional plot <a href="http://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab2.png"><img decoding="async" width="233" height="58" class="alignnone size-full wp-image-2280" src="http://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab2.png" alt="plotting-in-matlab"></a></p>



<p class="wp-block-paragraph"> plot <em>f</em></p>



<h2 class="wp-block-heading">Conditional plotting in Matlab</h2>



<p class="wp-block-paragraph">One of the way you can walk to easily plot <em>f</em><em>&nbsp;</em>is the following <span style="text-decoration: underline;">Matlab code</span></p>


<pre>x=-5:0.1:5;
for n=1:length(x)
if x(n)&amp;lt;1
f(n)=x(n)^3;
else
f(n)=x(n)^2;
end
end
plot(x,f,'--r','linewidth',2)</pre>



<p class="wp-block-paragraph">which returns </p>



<figure class="wp-block-image size-large"><img decoding="async" src="http://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab1.png" alt=""/></figure>



<p class="wp-block-paragraph">If you were just to plot half of the graph each time and add up plots, the code would look like</p>


<pre>% Part 1
x=-5:0.1:1;
f=x.^3;
plot(x,f,'--b','linewidth',2);
% Part 2
x=1:0.1:5;
f=x.^2;
hold on;
plot(x,f,'--r','linewidth',2)</pre>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab.png"><img fetchpriority="high" decoding="async" width="501" height="371" src="http://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab.png" alt="plotting-in-matlab" class="wp-image-2282" srcset="https://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab.png 501w, https://tutorial45.com/wp-content/uploads/2015/07/plotting-in-matlab-300x222.png 300w" sizes="(max-width: 501px) 100vw, 501px" /></a></figure>



<h3 class="wp-block-heading">Content you might like:</h3>



<ul class="wp-block-list"><li><a title="Plotting in Matlab – The Basics" href="http://tutorial45.com/plotting-in-matlab/">Plotting in Matlab – The Basics</a></li><li><a title="Graph the equation by plotting points" href="http://tutorial45.com/graph-the-equation-by-plotting-points/">Graph the equation by plotting points</a></li><li><a title="Plotting equations using EZPLOT – Matlab" href="http://tutorial45.com/plotting-equations-using-ezplot-matlab/">Plotting equations using EZPLOT – Matlab</a></li><li><a title="EZPLOT vs PLOT in Matlab" href="http://tutorial45.com/ezplot-vs-plot-in-matlab/">EZPLOT vs PLOT in Matlab</a></li><li><a title="Conditional plotting in Matlab" href="http://tutorial45.com/conditional-plotting-in-matlab/">Conditional plotting in Matlab</a></li><li><a title="Matlab plot colors and Styles" href="http://tutorial45.com/matlab-plot-colors-and-styles/">Matlab plot colors and Styles</a></li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/conditional-plotting-in-matlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write a Function That Find the Volume of a 3D Rectangle in Matlab</title>
		<link>https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/</link>
					<comments>https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 15:28:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=1672</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/">Write a Function That Find the Volume of a 3D Rectangle in Matlab</a></p>
<p>There is a function behind every Matlab code that performs a computational task, and here is how you can create your own function that will help you go faster while working with Matlab. We will be creating a simple one-line code function in this post, just to help you have a glimpse into how creating ... </p>
<p class="read-more-container"><a title="Write a Function That Find the Volume of a 3D Rectangle in Matlab" class="read-more button" href="https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/#more-1672" aria-label="More on Write a Function That Find the Volume of a 3D Rectangle in Matlab">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/">Write a Function That Find the Volume of a 3D Rectangle in Matlab</a></p>
<p>There is a function behind every <a href="http://tutorial45.com/euler-method-matlab-code/">Matlab code</a> that performs a computational task, and here is how you can create your own function that will help you go faster while working with Matlab.</p>
<p>We will be creating a simple one-line code function in this post, just to help you have a glimpse into how creating functions in Matlab</p>
<h2>Write a function in Matlab</h2>
<p>Here is what you do when <a href="https://tutorial45.com/matlab-function-that-rotate-a-matrix/">writing your own function in Matlab</a>.</p>
<p>Open a new function file</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab.png"><img decoding="async" class="alignnone size-full wp-image-1704" src="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab.png" alt="write-a-function-in-matlab" width="322" height="527" srcset="https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab.png 322w, https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab-183x300.png 183w" sizes="(max-width: 322px) 100vw, 322px" /></a></p>
<p>Here is what appear on the next window</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1705" src="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab1.png" alt="write-a-function-in-matlab" width="582" height="328" srcset="https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab1.png 582w, https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab1-300x169.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></a></p>
<p>In Matlab, the section after the <strong>%</strong> is considered as a comment (<em>the section that appears in green in the window above</em>)</p>
<p>Here is how we need to structure our <a href="https://tutorial45.com/e-matlab-scalar-function/">Matlab function</a></p>
<p>[php]function [v] = vol(L,W,H)<br />
% L is the length of the 3D rectangle<br />
% W is the width of the 3D rectangle<br />
% H is the height of the 3D rectangle<br />
v= L*W*H;<br />
end[/php]</p>
<p>You need to copy the whole code above and paste it in the file, Save the file with the name <strong>vol.m</strong> and make sure not to change the directory Matlab will guide you to.</p>
<p>Here is how it will look</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1709" src="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab3.png" alt="write-a-function-in-matlab" width="587" height="334" srcset="https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab3.png 587w, https://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab3-300x171.png 300w" sizes="(max-width: 587px) 100vw, 587px" /></a></p>
<h2>How to use the Matlab function we have just created</h2>
<p>Every time you will need to compute the such a volume, simply type the following code</p>
<pre>vol(L,W,H)</pre>
<p>where L, W, And H will be real numbers.</p>
<h4>Example</h4>
<p>Let&#8217;s say, we need the volume of a 3D rectangle with L, W and H being respectively 10, 3, 15, we can simply type:</p>
<pre>vol(10,3,15)</pre>
<p>And Matlab will call the function <strong>vol,</strong> compute the volume of the 3D rectangle and display the following.</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1706" src="http://tutorial45.com/wp-content/uploads/2015/06/write-a-function-in-matlab2.png" alt="write-a-function-in-matlab" width="145" height="103"></a></p>
<p>If you are working in an exercise where you will often need this volume, you can just use this function instead of actually computing manually the volume each time you need it. It might not look very important in this exercise, but when you have a complex <a href="https://tutorial45.com/matlab-matrix-operations/">operation you need to perform often in Matlab</a>, creating a function doing it automatically will be time-efficient and necessary.</p>
<p>Using this technique, you can <a href="https://tutorial45.com/matlab-tricks-creating-an-array-modifying-matrix-elements/">create more complex functions in Matlab</a> and have an easier life while using them. <a href="http://de.mathworks.com/help/matlab/ref/function.html" target="_blank" rel="noopener noreferrer">Learn more about functions in Matlab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/write-functions-volume-3d-rectangle-matlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>3 Best Free Matlab Alternatives</title>
		<link>https://tutorial45.com/best-free-matlab-alternative/</link>
					<comments>https://tutorial45.com/best-free-matlab-alternative/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 15:07:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=3856</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/best-free-matlab-alternative/">3 Best Free Matlab Alternatives</a></p>
<p>In the world of tech devices, the Apple brand is the Holy Grail and wherever it is mentioned other tech brands usually bow their heads in shame. And same goes for Matlab the undisputed king of the numerical computations niche. This software is loved by both experienced engineers and students alike, saddled with the responsibility ... </p>
<p class="read-more-container"><a title="3 Best Free Matlab Alternatives" class="read-more button" href="https://tutorial45.com/best-free-matlab-alternative/#more-3856" aria-label="More on 3 Best Free Matlab Alternatives">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/best-free-matlab-alternative/">3 Best Free Matlab Alternatives</a></p>

<p class="wp-block-paragraph">In the world of tech devices, the Apple brand is the Holy Grail and wherever it is mentioned other tech brands usually bow their heads in shame. And same goes for Matlab the undisputed king of the numerical computations niche. This software is loved by both experienced engineers and students alike, saddled with the responsibility of computing numbers, processing images, and data acquisition. Therefore, it’s widespread fame, features and abilities are well known but little do we talk about the cost of purchasing the original software as well as its add-ons and the effect they have on our pockets.</p>



<p class="wp-block-paragraph">For anyone who does not have the resources to purchase Matlab’s <a href="https://tutorial45.com/easy-cad-software-applications-anyone-can-use/">software or the corresponding add-ons you need</a> to handle certain projects, here is some god news for you. There are a couple of matrix language software applications out there on the market that you can easily purchase without punching a hole in your pockets and we will be reviewing three of such alternatives in the coming paragraphs. And here is our list of criteria to consider for the alternatives provided in the list below.</p>



<p class="wp-block-paragraph">It runs on Windows: the <a href="https://tutorial45.com/the-most-popular-cad-software/">popularity of Windows OS means that most students or people in general will have to run the software</a> on a Windows powered PC sooner or later. So our alternative must run on Windows.</p>



<p class="wp-block-paragraph">It should be Compatible with Matlab: since Matlab has the first-mover advantage over its competitors, it is important for others to ensure imported and exported files can be used on Matlab and <a href="https://tutorial45.com/how-to-convert-numbers-from-polar-to-cartesian-form-and-vice-versa/">vice versa</a>.<br>It should have a good User Interface: A seamless interface which is easy to use coupled with a basic command line and other simplistic features will also be considered.</p>



<h2 class="wp-block-heading">Matlab alternatives</h2>



<h3 class="wp-block-heading">Octave</h3>



<p class="wp-block-paragraph"><a href="https://www.gnu.org/software/octave/" target="_blank" rel="noopener noreferrer">Octave is a free matrix language</a> software application built by GNU engineers with the aim of simplifying computations as well as to provide students with a non-commercial software option to work with. This <a href="https://tutorial45.com/best-pcb-design-software-for-electrical-engineers/">software is spectacular in many ways because it was basically developed by engineers</a> to be used by engineers; therefore, it cuts out unnecessary fluff and procedures during its use. Using our criteria to review Octave we have:</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="http://tutorial45.com/wp-content/uploads/2016/06/matlab-alternative-Octave.png" alt="matlab-alternative-Octave" class="wp-image-3859" width="114" height="114" srcset="https://tutorial45.com/wp-content/uploads/2016/06/matlab-alternative-Octave.png 200w, https://tutorial45.com/wp-content/uploads/2016/06/matlab-alternative-Octave-150x150.png 150w, https://tutorial45.com/wp-content/uploads/2016/06/matlab-alternative-Octave-50x50.png 50w" sizes="(max-width: 114px) 100vw, 114px" /></figure></div>



<p class="wp-block-paragraph">Octave was built to run on both Windows and <a href="https://tutorial45.com/autocad-for-linux-the-alternatives/">Linux OS’s seamlessly and to top</a> this off, the software is totally free on both platforms and can be downloaded from the GNU website or at some engineering online forums.</p>



<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Octave Tutorial #1 - Introduction &amp; Setup" width="800" height="450" src="https://www.youtube.com/embed/X0xLTKRWPgo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Also important to this discussion is the fact that Octave is 95% compatible with MATLAB which makes it a great resource for students. Octave <a href="https://tutorial45.com/matlab-function-that-rotate-a-matrix/">functions are declared in the same way as MATLABs’ and it has simple commands for saving and loading matrices and commands that were built for MATLAB</a>. On an unrelated note, Octave works simultaneously with other GNU software applications such as Gnuplot and plplot which makes it capable of <a href="https://tutorial45.com/graph-the-equation-by-plotting-points/">plotting diverse graphs</a> and also display images.</p>



<p class="wp-block-paragraph">Octave’s fast matrix routines, syntax, inclusion of an iterative history, numerous mathematical solutions utilities and its soft learning curve makes it a great alternative to MATLAB</p>



<h3 class="wp-block-heading">Scilab</h3>



<p class="wp-block-paragraph">Another contender to the MATLAB throne, known for its <a href="http://www.scilab.org/" target="_blank" rel="noopener noreferrer">high-level computation abilities is Scilab</a>. Scilab is an open source software for numerical <a href="https://tutorial45.com/computer-engineering-vs-computer-science/">computation and provides a solid computing ecosystem for engineering</a> and other scientific computation.</p>



<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="How to plot 2D graphs in Scilab [TUTORIAL]" width="800" height="450" src="https://www.youtube.com/embed/mY7EBULfJzY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">Some long time users of this software application claim that it is quite better than both Octave and MATLAB due to the advanced math operations and engineering analysis it can handle but whether this is true or not, it stands as a testament to its computational abilities as a good alternative to MATLAB both students and working professionals should consider. Reviewing Scilab using our criteria we get:</p>



<p class="wp-block-paragraph">Scilab takes the compatibility issue a step further for it is compatible on more platform operating systems than the Octave Scilab runs on all Windows operating systems, Linux as well as OS X. The software application can be found and downloaded online from Scilab Enterprise’s official website.</p>



<p class="wp-block-paragraph">Unlike the Octave which is closely modelled after MATLAB in terms of syntax, Scilab is a little bit different and its functions and commands are declared by using different but simple formats which anyone can easily learn. Scilab takes simulation, design and analysis a step further by including a ‘hybrid dynamic systems modeller and simulator’ for modelling mechanical systems, control systems and other high-level mathematical operations.</p>



<p class="wp-block-paragraph">Scilab may have some differences from MATLAB but any active user of the software application can quickly learn how to use it as a powerful tool for numerical computation and otherwise which makes it a powerful alternative to MATLAB. Do not forget that it’s also free.</p>



<h3 class="wp-block-heading">FreeMat</h3>



<p class="wp-block-paragraph"><a href="http://freemat.sourceforge.net/" target="_blank" rel="noopener noreferrer">This is another open source</a> environment for rapid engineering and scientific processing that is quite similar to MATLAB in terms of syntax which makes it a perfect alternative to MATLAB. The FreeMat platform was built in MIT as a cheaper alternative to the more commercial numerical computation languages out there and it&#8217;s completely free package ensures it comes cheap to students.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="429" height="128" src="http://tutorial45.com/wp-content/uploads/2016/06/free-matlab-alternative-freemat.png" alt="free-matlab-alternative-freemat" class="wp-image-3864" srcset="https://tutorial45.com/wp-content/uploads/2016/06/free-matlab-alternative-freemat.png 429w, https://tutorial45.com/wp-content/uploads/2016/06/free-matlab-alternative-freemat-300x90.png 300w" sizes="(max-width: 429px) 100vw, 429px" /></figure></div>



<p class="wp-block-paragraph">Like Scilab, FreeMat works on multiple operating systems which include Windows, OS X, <a href="https://tutorial45.com/ubuntu-vs-linux-mint/" >and Linux</a>. As stated earlier, the application is totally free and can be downloaded from the FreeMat official website and other student design and simulation forums.</p>



<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="ENGR 100 FreeMat Tutorial 01" width="800" height="450" src="https://www.youtube.com/embed/LZYgAFmlDMQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">In terms of compatibility, FreeMat can easily be called the closest clone to MATLAB as it supports approximately 97% of the features in MATLAB which is quite good for anyone looking for something close to MATLAB but cheaper. Its cloned features include support for; all the integer types Matlab supports, dynamic array types, N-dimensional array manipulation , built in arithmetic manipulation of data types, command lines etc. A good knowledge of MATLAB is all you need to start using FreeMat.</p>



<p class="wp-block-paragraph">The multiple similarities between FreeMat and MATLAB may make it the best alternative software on this list. But there is no denying that it is one of the favourites anyone looking for something really similar should consider using.</p>



<h2 class="wp-block-heading">Final thought</h2>



<p class="wp-block-paragraph">In conclusion, despite the differences between the above-listed languages and MATLAB, each and every one of these applications has its own merit which makes them viable options for your numerical computations at no cost whatsoever. Students and hobbyists should consider them as perfect alternatives.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/best-free-matlab-alternative/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Matlab Polynomial: Division and Multiplication</title>
		<link>https://tutorial45.com/matlab-polynomial/</link>
					<comments>https://tutorial45.com/matlab-polynomial/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 14:52:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=2157</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/matlab-polynomial/">Matlab Polynomial: Division and Multiplication</a></p>
<p>We have recently learned how to solve polynomial equations in Matlab, now we are going to visit a trick that will help you learn how to do Division and Multiplication of polynomial using Matlab. Polynomial Division example Polynomial Multiplication example Matlab Polynomial Multiplication of polynomial can be a very dreary task, so do the division ... </p>
<p class="read-more-container"><a title="Matlab Polynomial: Division and Multiplication" class="read-more button" href="https://tutorial45.com/matlab-polynomial/#more-2157" aria-label="More on Matlab Polynomial: Division and Multiplication">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/matlab-polynomial/">Matlab Polynomial: Division and Multiplication</a></p>
<p>We have recently learned <a href="http://tutorial45.com/solving-polynomial-equations-using-matlab/">how to solve polynomial equations in Matlab</a>, now we are going to visit a trick that will help you learn how to do Division and Multiplication of polynomial using Matlab.</p>
<h2>Polynomial Division example</h2>
<p><!--NoAds--><br />
<a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2160" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial1.png" alt="matlab-polynomial" width="389" height="33" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial1.png 389w, https://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial1-300x25.png 300w" sizes="(max-width: 389px) 100vw, 389px" /></a></p>
<h2>Polynomial Multiplication example</h2>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial8.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2178" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial8.png" alt="matlab-polynomial" width="208" height="53" /></a></p>
<h2>Matlab Polynomial</h2>
<p>Multiplication of polynomial can be a very dreary task, so do the division of polynomial. Matlab uses the functions<strong> conv</strong> and <strong>deconv</strong> to help you do these tasks with the least commotion possible, and most importantly with the assurance to find the right result the quickest way <em>possible</em>.</p>
<p>Let get on some examples, those will help easily learn how to make use of <strong>conv</strong> (for multiplication) and <strong>deconv</strong> (for division).</p>
<div class="message_box success">
<p>Caution! We will not show you how to manually solve polynomial multiplication and polynomial division manually here. Matlab will help you do it, but it will not show you how to do it, so at this point we supposed you know how it is done. Check <a href="https://www.mathsisfun.com/algebra/polynomials-multiplying.html" target="_blank" rel="noopener noreferrer">how to do it manually</a> if you do not.</p>
</div>
<h3>Example 1</h3>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial4.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2168" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial4.png" alt="matlab-polynomial" width="227" height="34" /></a></p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>s=[1 4];
t=[1 4 -3];
conv(s,t)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2169" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial3.png" alt="matlab-polynomial" width="235" height="55" /></a></p>
<p>Rewritten, it gives the following</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial6.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2172" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial6.png" alt="matlab-polynomial" width="187" height="25" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial6.png 187w, https://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial6-180x25.png 180w" sizes="(max-width: 187px) 100vw, 187px" /></a></p>
<h3>Example 2</h3>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial5.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2171" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial5.png" alt="matlab-polynomial" width="116" height="53" /></a></p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>c=[1 0 4];
u=[1 3];
[p,r]=deconv(c,u)% r is the remainder of the division</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial7.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2174" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial7.png" alt="matlab-polynomial" width="175" height="147" /></a></p>
<p>Rewritten, it gives</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial9.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2179" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial9.png" alt="matlab-polynomial" width="122" height="53" /></a></p>
<h3>A bit of clarity</h3>
<p><em>Top-down conversion</em>. Here we simply need to indicate the coefficient and their position in the polynomial equation.</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial11.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2183" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial11.png" alt="matlab-polynomial" width="228" height="105" /></a></p>
<p><em>Bottom-up conversion</em>. Here we need to read Matlab outputs and rewrite it the way it is supposed to be, and it goes like this.</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial10.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2182" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial10.png" alt="matlab-polynomial" width="207" height="123" /></a></p>
<p>Remember you need to put a zero, in case an order is not represented in the equation. <em>See the example below</em></p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial12.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2184" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-polynomial12.png" alt="matlab-polynomial" width="218" height="119" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/matlab-polynomial/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Left Division vs Right Matrix Division – Matlab</title>
		<link>https://tutorial45.com/matrix-division-matlab/</link>
					<comments>https://tutorial45.com/matrix-division-matlab/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 14:03:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=2250</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/matrix-division-matlab/">Left Division vs Right Matrix Division – Matlab</a></p>
<p>There are two operators allowing to divide in Matlab: The right division represented by the symbol / (slash) The left division represented by the symbol \ (Backslash) These two operators differ from each other Using numbers, the right division will be the conventional division we all day make use of, so Contrary to the right ... </p>
<p class="read-more-container"><a title="Left Division vs Right Matrix Division – Matlab" class="read-more button" href="https://tutorial45.com/matrix-division-matlab/#more-2250" aria-label="More on Left Division vs Right Matrix Division – Matlab">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/matrix-division-matlab/">Left Division vs Right Matrix Division – Matlab</a></p>

<p class="wp-block-paragraph">There are two operators allowing to divide in Matlab:</p>



<ul class="wp-block-list"><li>The right division represented by the symbol / <em>(slash)</em></li><li>The left division represented by the symbol \ <em>(Backslash)</em></li></ul>



<p class="wp-block-paragraph">These two operators differ from each other</p>



<p class="wp-block-paragraph">Using numbers, the right division will be the conventional division we all day make use of, so</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab.png"><img loading="lazy" decoding="async" width="100" height="31" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab.png" alt="matrix-division-matlab" class="wp-image-2254"/></a></figure>



<p class="wp-block-paragraph">Contrary to the right division, the left division reverse the division, meaning</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab1.png"><img loading="lazy" decoding="async" width="174" height="34" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab1.png" alt="matrix-division-matlab" class="wp-image-2255"/></a></figure>



<h2 class="wp-block-heading">Matrix division in Matlab</h2>



<h3 class="wp-block-heading">The right Matrix divide</h3>



<p class="wp-block-paragraph">Let&#8217;s consider two Matrices A and B</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab2.png"><img loading="lazy" decoding="async" width="228" height="49" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab2.png" alt="matrix-division-matlab" class="wp-image-2256"/></a></figure>



<p class="wp-block-paragraph">Using the right division</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab3.png"><img loading="lazy" decoding="async" width="182" height="29" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab3.png" alt="matrix-division-matlab" class="wp-image-2257" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab3.png 182w, https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab3-180x29.png 180w" sizes="(max-width: 182px) 100vw, 182px" /></a></figure>



<p class="wp-block-paragraph"><span style="text-decoration: underline;">Matlab code</span></p>


<pre>A=[1 2 ; 2 2];
B=[3 2 ; 1 1];
A/B % You can also use A*inv(B)</pre>



<p class="wp-block-paragraph">which returns</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab4.png"><img loading="lazy" decoding="async" width="255" height="151" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab4.png" alt="matrix-division-matlab" class="wp-image-2258"/></a></figure>



<p class="wp-block-paragraph">rewritten, it will look like this</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab5.png"><img loading="lazy" decoding="async" width="148" height="48" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab5.png" alt="matrix-division-matlab" class="wp-image-2259"/></a></figure>



<h3 class="wp-block-heading">The left Matrix divide</h3>



<p class="wp-block-paragraph">The right matrix divide is roughly the same as</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab6.png"><img loading="lazy" decoding="async" width="225" height="34" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab6.png" alt="matrix-division-matlab" class="wp-image-2260"/></a></figure>



<p class="wp-block-paragraph">Which leads to a complete different result from the preceding operator.</p>



<p class="wp-block-paragraph">This technique can be used to quickly compute the solution of the equation</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab7.png"><img loading="lazy" decoding="async" width="193" height="37" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab7.png" alt="matrix-division-matlab" class="wp-image-2261"/></a></figure>



<p class="wp-block-paragraph">So, using our early defined matrices</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab8.png"><img loading="lazy" decoding="async" width="51" height="37" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab8.png" alt="matrix-division-matlab" class="wp-image-2262" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab8.png 51w, https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab8-50x37.png 50w" sizes="(max-width: 51px) 100vw, 51px" /></a></figure>



<p class="wp-block-paragraph">will be written</p>


<pre>A=[1 2 ; 2 2];
B=[3 2 ; 1 1];
A\B % You can also use inv(A)*B</pre>



<p class="wp-block-paragraph">which returns</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab9.png"><img loading="lazy" decoding="async" width="262" height="152" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab9.png" alt="matrix-division-matlab" class="wp-image-2263"/></a></figure>



<p class="wp-block-paragraph">Which rewritten will look like</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab10.png"><img loading="lazy" decoding="async" width="162" height="47" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab10.png" alt="matrix-division-matlab" class="wp-image-2264"/></a></figure>



<h2 class="wp-block-heading">The Matrix division, element by element</h2>



<p class="wp-block-paragraph">We thought it will be also necessary you have a grip on the element-by-element Matrix division in Matlab</p>



<p class="wp-block-paragraph">To divide Matrices, element-by-element, the following formula is useful</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab11.png"><img loading="lazy" decoding="async" width="54" height="28" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab11.png" alt="matrix-division-matlab" class="wp-image-2269"/></a></figure>



<p class="wp-block-paragraph">Where</p>



<figure class="wp-block-image"><a href="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab12.png"><img loading="lazy" decoding="async" width="308" height="102" src="http://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab12.png" alt="matrix-division-matlab" class="wp-image-2270" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab12.png 308w, https://tutorial45.com/wp-content/uploads/2015/07/matrix-division-matlab12-300x99.png 300w" sizes="(max-width: 308px) 100vw, 308px" /></a></figure>



<p class="wp-block-paragraph"><span style="text-decoration: underline;">The code</span></p>



<pre>A./B</pre>



<h3 class="wp-block-heading">Content you might like:</h3>



<ul class="wp-block-list"><li><a title="Matlab Matrix Operations" href="http://tutorial45.com/matlab-matrix-operations/">Matlab Matrix Operations</a></li><li><a title="Write a Matlab function that rotate a Matrix by 90 degrees" href="http://tutorial45.com/matlab-function-that-rotate-a-matrix/">Write a Matlab function that rotates a Matrix by 90 degrees</a></li><li><a title="Matrix multiplication – Matlab" href="http://tutorial45.com/matrix-multiplication-matlab/">Matrix multiplication – Matlab</a></li><li><a title="Matlab tricks: Creating an “array”, modifying matrix elements" href="http://tutorial45.com/matlab-tricks-creating-an-array-modifying-matrix-elements/">Matlab tricks: Creating an “array”, modifying matrix elements</a></li><li><a title="Sort a matrix in Matlab" href="http://tutorial45.com/matlab-sort-matrix/">How to sort a matrix in Matlab</a></li><li><a title="Vectors in Matlab: Basic Operations" href="http://tutorial45.com/vectors-in-matlab-basic-operations/">Vectors in Matlab: Basic Operations</a></li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/matrix-division-matlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Plotting Equations Using EZPLOT – Matlab</title>
		<link>https://tutorial45.com/plotting-equations-using-ezplot-matlab/</link>
					<comments>https://tutorial45.com/plotting-equations-using-ezplot-matlab/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 13:59:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=1545</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/plotting-equations-using-ezplot-matlab/">Plotting Equations Using EZPLOT – Matlab</a></p>
<p>Plotting is a very important step in the study of a system since it helps understand the behavior and the restrictions of the system with less effort possible. Plotting an equation is not always an easy task especially if you have to work out all the parameters manually, luckily nowadays there are tons of tools ... </p>
<p class="read-more-container"><a title="Plotting Equations Using EZPLOT – Matlab" class="read-more button" href="https://tutorial45.com/plotting-equations-using-ezplot-matlab/#more-1545" aria-label="More on Plotting Equations Using EZPLOT – Matlab">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/plotting-equations-using-ezplot-matlab/">Plotting Equations Using EZPLOT – Matlab</a></p>
<p>Plotting is a very important step in the study of a system since it helps understand the behavior and the restrictions of the system with less effort possible.</p>
<p>Plotting an equation is not always an easy task especially if you have to work out all the parameters manually, luckily nowadays there are tons of tools that help plot equations.</p>
<p><a href="https://tutorial45.com/best-free-matlab-alternative/">Matlab is the most popular tool</a> out there when it comes to the study of the system, and in this post, we are going to work with some basic equations, Matlab, and most importantly make use of EZPLOT for plotting equations.</p>
<h2>Plotting equations in Matlab using EZPLOT</h2>
<h3> Ezplot Matlab example</h3>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/plot-equation-in-matlab.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1549" src="http://tutorial45.com/wp-content/uploads/2015/06/plot-equation-in-matlab.png" alt="plot-equation-in-matlab" width="189" height="36" /></a></p>
<p>To plot this equation in Matlab using the EZPLOT, We will write the equation the following way</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/plot-equation-in-matlab1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1550" src="http://tutorial45.com/wp-content/uploads/2015/06/plot-equation-in-matlab1.png" alt="plot-equation-in-matlab" width="223" height="39" /></a></p>
<p>Now type the following code and press ENTER</p>
<pre>ezplot('y-x^3-x^2+x-1',[-5 5 -5 5])</pre>
<p>And you will obtain the following figure</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/plotting-in-matlab3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1640" src="http://tutorial45.com/wp-content/uploads/2015/06/plotting-in-matlab3.png" alt="plotting-in-matlab" width="405" height="537" srcset="https://tutorial45.com/wp-content/uploads/2015/06/plotting-in-matlab3.png 405w, https://tutorial45.com/wp-content/uploads/2015/06/plotting-in-matlab3-226x300.png 226w" sizes="(max-width: 405px) 100vw, 405px" /></a></p>
<p>If you would like to have more information about the command we just used, you can find it by using the following code</p>
<pre>doc ezplot</pre>
<p>While using the EZPLOT, the structure of the code is the following</p>
<p>ezplot(fun,[xmin,xmax,ymin,ymax])</p>
<p>Where <em>fun</em> is the equation, <em>xmin</em> and <em>xmax</em> are respectively the lower and the highest value of x, <em>ymin</em> and <em>ymax</em> the lowest and highest value of y. If the most interesting part of the graph your are plotting is happening in a larger interval than the one we just plotted, you may need to increase the value of xmin, xmax, ymin, and ymax.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/plotting-equations-using-ezplot-matlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Scalar Functions in Matlab: E Matlab, Cosine Function and More</title>
		<link>https://tutorial45.com/e-matlab-scalar-function/</link>
					<comments>https://tutorial45.com/e-matlab-scalar-function/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 13:56:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=2188</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/e-matlab-scalar-function/">Scalar Functions in Matlab: E Matlab, Cosine Function and More</a></p>
<p>These are a few basic tools you will need to know if you are just starting learning Matlab. Scalar functions in Matlab Before fully diving into trigonometric functions, it is necessary to state that Matlab takes as input radians while working with trigonometric function meaning and uses the symbol pi for π Trigonometric sine Matlab ... </p>
<p class="read-more-container"><a title="Scalar Functions in Matlab: E Matlab, Cosine Function and More" class="read-more button" href="https://tutorial45.com/e-matlab-scalar-function/#more-2188" aria-label="More on Scalar Functions in Matlab: E Matlab, Cosine Function and More">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/e-matlab-scalar-function/">Scalar Functions in Matlab: E Matlab, Cosine Function and More</a></p>
<p>These are a few basic tools you will need to know if you are just starting learning Matlab.</p>
<h2>Scalar functions in Matlab</h2>
<p>Before fully diving into trigonometric functions, it is necessary to state that Matlab takes as input radians while working with trigonometric function meaning and uses the symbol <em>pi</em> for <strong><em><span class="st">π</span></em></strong><!--NoAds--></p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2190" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab1.png" alt="e-matlab" width="329" height="96" srcset="https://tutorial45.com/wp-content/uploads/2015/07/e-matlab1.png 329w, https://tutorial45.com/wp-content/uploads/2015/07/e-matlab1-300x88.png 300w" sizes="(max-width: 329px) 100vw, 329px" /></a></p>
<h3>Trigonometric sine</h3>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab4.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2194" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab4.png" alt="e-matlab" width="69" height="26" /></a></p>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>sin(pi)</pre>
<h3>Trigonometric cosine</h3>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2193" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab3.png" alt="e-matlab" width="68" height="25" /></a></p>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>cos(pi)</pre>
<h3>Trigonometric tangent</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2197" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab2.png" alt="e-matlab" width="93" height="51" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>tan(3*pi/2)</pre>
<h3>Trigonometric inverse sine (arcsine)</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab6.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2205" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab6.png" alt="e-matlab" width="96" height="29" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>asin(1)</pre>
<h3>Trigonometric inverse cosine (arccos)</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab7.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2206" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab7.png" alt="e-matlab" width="116" height="30" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>acos(0.5)</pre>
<h3>Trigonometric inverse tangent (arctan)</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab5.png"><img loading="lazy" decoding="async" class="alignnone wp-image-2207 size-full" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab5.png" alt="e-matlab" width="107" height="52" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>atan(3/2)</pre>
<h3>e Matlab (exponential)</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab8.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2201" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab8.png" alt="e-matlab" width="27" height="29" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>exp(x)</pre>
<h3>Natural logarithm</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab9.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2202" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab9.png" alt="e-matlab" width="77" height="51" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>log(5/2)</pre>
<h3>Absolute value</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab10.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2203" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab10.png" alt="e-matlab" width="83" height="29" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>abs(a*x+b)</pre>
<h3>Square root</h3>
<h3><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab11.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2204" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab11.png" alt="e-matlab" width="54" height="34" /></a></h3>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>sqrt(a*b)</pre>
<h3>Remainder after division</h3>
<p>This function helps you find the remainder after a division. We will use as an example the remainder of the division of 5 by 2, which is one.</p>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>rem(5,2)</pre>
<p>which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab13.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2216" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab13.png" alt="e-matlab" width="115" height="50" /></a></p>
<h3>Round towards nearest integer</h3>
<p>This function will allow you to round values towards the nearest integer if you are not interested in working with decimal numbers. It is most useful while you want to round the result of an operation.</p>
<p><span style="text-decoration: underline;">Matlab code</span></p>
<pre>round(2.9)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab12.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2212" src="http://tutorial45.com/wp-content/uploads/2015/07/e-matlab12.png" alt="e-matlab" width="77" height="54" /></a></p>
<h3>Round towards negative infinity</h3>
<p><em><strong>floor(x)</strong></em> rounds the elements of<em><strong> x</strong></em> to the nearest integers towards minus infinity.</p>
<h3>Round towards positive infinity</h3>
<p>As opposed to the <em><strong>floor</strong></em> function, <strong><em>ceil(x)</em></strong> rounds the elements of <em><strong>x</strong></em> to the nearest integers towards infinity.</p>
<h3>Articles you might like:</h3>
<ul>
<li><a title="Write a function that find the volume of a 3D rectangle in Matlab" href="http://tutorial45.com/write-functions-volume-3d-rectangle-matlab/">Write a function that finds the volume of a 3D rectangle in Matlab</a></li>
<li><a title="Scalar functions in Matlab: e Matlab, Cosine function and more" href="http://tutorial45.com/e-matlab-scalar-function/">Scalar functions in Matlab: e Matlab, Cosine function and more</a></li>
<li><a title="Left division vs Right Matrix division – Matlab" href="http://tutorial45.com/matrix-division-matlab/">Left division vs Right Matrix division – Matlab</a></li>
<li><a href="http://tutorial45.com/how-to-convert-numbers-from-polar-to-cartesian-form-and-vice-versa/">Convert numbers from Polar to Cartesian and vice versa</a></li>
<li><a href="https://tutorial45.com/best-free-matlab-alternative/">Free Matlab Alternative</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/e-matlab-scalar-function/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Matlab Solves System of Equations</title>
		<link>https://tutorial45.com/matlab-solves-system-equations/</link>
					<comments>https://tutorial45.com/matlab-solves-system-equations/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 13:52:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=1557</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/matlab-solves-system-equations/">Matlab Solves System of Equations</a></p>
<p>Solving a system of equations with two unknowns is a very easy cake to bite but when the number of unknown exceed two, solving the system of equations becomes complicated and time-consuming. In this post, we are going to show you how you can use your computer and Matlab to solve a system of many ... </p>
<p class="read-more-container"><a title="Matlab Solves System of Equations" class="read-more button" href="https://tutorial45.com/matlab-solves-system-equations/#more-1557" aria-label="More on Matlab Solves System of Equations">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/matlab-solves-system-equations/">Matlab Solves System of Equations</a></p>
<p>Solving a <a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations.png">system of equations</a> with two unknowns is a very easy <em>cake to bite</em> but when the number of unknown exceed two, solving the system of equations becomes complicated and time-consuming.</p>
<p>In this post, we are going to show you how you can use your computer and <a href="http://en.wikipedia.org/wiki/MATLAB" target="_blank" rel="noopener noreferrer">Matlab</a> to solve a system of many equations.</p>
<p><em>Caution: the following technique works only when the number of equations and the number of unknowns are the same. We will solely work will <a href="http://en.wikipedia.org/wiki/Linear_equation" target="_blank" rel="noopener noreferrer">linear equations </a></em></p>
<h2>Can Matlab solve a system of equations?</h2>
<p>Yes, Matlab can help you easily solve a system of equations. Let&#8217;s jump into some examples and show you how you go about it.</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1.jpg"><img loading="lazy" decoding="async" class=" wp-image-1594 aligncenter" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1.jpg" alt="Matlab-solves-system-of-equations" width="499" height="332" srcset="https://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1.jpg 640w, https://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1-300x200.jpg 300w, https://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1-180x120.jpg 180w" sizes="(max-width: 499px) 100vw, 499px" /></a></p>
<h3>Using Matlab to Solve a system of equation with two unknowns</h3>
<p>Let&#8217;s consider the following system of equations</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1596" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations.png" alt="Matlab-solves-system-of-equations" width="159" height="68" /></a></p>
<p>The above equation can be written in the matrix form</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1597" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations1.png" alt="Matlab-solves-system-of-equations" width="223" height="178" /></a></p>
<p>The equation can be rewritten as</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1598" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations2.png" alt="Matlab-solves-system-of-equations" width="197" height="72" /></a></p>
<p>Now we are set to use Matlab!</p>
<pre>A=[2 3;1 1];
B=[8;3];
X=inv(A)*B</pre>
<p><em>The last line does not have; at the end.</em></p>
<p>You will see an answer like this</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1599" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations3.png" alt="Matlab-solves-system-of-equations" width="121" height="115" /></a></p>
<p>Which simply means that</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations4.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1600" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations4.png" alt="Matlab-solves-system-of-equations" width="187" height="39" srcset="https://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations4.png 187w, https://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations4-180x39.png 180w" sizes="(max-width: 187px) 100vw, 187px" /></a></p>
<p>Let&#8217;s elaborate a little more in detail here before moving forward. What we have done above is the following.</p>
<p>We have written the equation in the form</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations5.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1602" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations5.png" alt="Matlab-solves-system-of-equations" width="116" height="38" /></a></p>
<p>Where</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations6.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1603" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations6.png" alt="Matlab-solves-system-of-equations" width="159" height="190" /></a></p>
<p>So to have at the end the equation on the form</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations7.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1604" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations7.png" alt="Matlab-solves-system-of-equations" width="156" height="94" /></a></p>
<h3>Example 2: System of the equation with three unknowns</h3>
<p>let&#8217;s consider the following system of equations</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations8.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1606" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations8.png" alt="Matlab-solves-system-of-equations" width="190" height="91" /></a></p>
<p>Using the same technique we used above we can write the system in the following form</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations9.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1607" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations9.png" alt="Matlab-solves-system-of-equations" width="279" height="92" /></a></p>
<p>Giving commands to Matlab will look like the following</p>
<pre>A=[1 3 -2;3 2 -1;2 -1 -3];
B=[1;2;13];
X=inv(A)*B</pre>
<p>To end up with the following result</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations10.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1608" src="http://tutorial45.com/wp-content/uploads/2015/06/Matlab-solves-system-of-equations10.png" alt="Matlab-solves-system-of-equations" width="135" height="130" /></a></p>
<h3>Final thought</h3>
<p>If you are working on a system of equations where the number of unknowns is equal to the number of equations, this method is a good way to go. This restriction is due to the fact that using the system of matrices to solve such system of equations requires that the matrix A is invertible. If there are no possibilities of finding the <em>inv(A)</em> then this method is totally useless.</p>
<h3>Posts you might like:</h3>
<ul>
<li><a title="Write a function that find the volume of a 3D rectangle in Matlab" href="http://tutorial45.com/write-functions-volume-3d-rectangle-matlab/">Write a function that finds the volume of a 3D rectangle in Matlab</a></li>
<li><a href="https://tutorial45.com/best-free-matlab-alternative/">Best free MATLAB alternative</a></li>
<li><a title="Scalar functions in Matlab: e Matlab, Cosine function and more" href="http://tutorial45.com/e-matlab-scalar-function/">Scalar functions in Matlab: e Matlab, Cosine function and more</a></li>
<li><a title="Left division vs Right Matrix division – Matlab" href="http://tutorial45.com/matrix-division-matlab/">Left division vs Right Matrix division – Matlab</a></li>
<li><a href="http://tutorial45.com/how-to-convert-numbers-from-polar-to-cartesian-form-and-vice-versa/">Convert numbers from Polar to Cartesian and vice versa</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/matlab-solves-system-equations/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Matlab Matrix Operations &#8211; Exercise</title>
		<link>https://tutorial45.com/matlab-matrix-operations-exercises/</link>
					<comments>https://tutorial45.com/matlab-matrix-operations-exercises/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 13:49:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=1860</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/matlab-matrix-operations-exercises/">Matlab Matrix Operations &#8211; Exercise</a></p>
<p>Lately we have learned some basics about Matlab matrix operations. Here come the part 2 of that post, where we will test our abilities of manipulating matrices in Matlab Matlab matrix operation exercise Exercise 1 Create a 1 x 5 vector A with all elements equal to 0 Exercise 2 Create a 3 x 1 ... </p>
<p class="read-more-container"><a title="Matlab Matrix Operations &#8211; Exercise" class="read-more button" href="https://tutorial45.com/matlab-matrix-operations-exercises/#more-1860" aria-label="More on Matlab Matrix Operations &#8211; Exercise">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/matlab-matrix-operations-exercises/">Matlab Matrix Operations &#8211; Exercise</a></p>
<p>Lately we have learned some basics about <a href="http://tutorial45.com/matlab-matrix-operations/">Matlab matrix operations</a>. Here come the part 2 of that post, where we will test our abilities of manipulating matrices in Matlab</p>
<h2>Matlab matrix operation exercise</h2>
<h3>Exercise 1</h3>
<p>Create a 1 x 5 vector A with all elements equal to 0</p>
<h3>Exercise 2</h3>
<p>Create a 3 x 1 vector B with with all elements equal to 1</p>
<h3>Exercise 3</h3>
<p>Create a 1 x 5 vector C with elements equal to 1, 2, 3, 4, <span class="st">π</span> respectively.</p>
<h3>Exercise 4</h3>
<p>Create 1-row vector D with element&#8217;s from 3 to 27 with step 3 by using the appropriate operator</p>
<h3>Exercise 5</h3>
<p>Create a 3 x 3 matrix E with elements with random values.</p>
<h3>Exercise 6</h3>
<p>Create the following matrix</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1866" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example.png" alt="matlab-matrix-operation-example" width="110" height="75"></a></p>
<h3>Exercise 7</h3>
<p>Check the size of <strong><em>F</em></strong></p>
<h3>Exercise 8</h3>
<p>Create the following Matrix</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1867" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example1.png" alt="matlab-matrix-operation-example" width="172" height="74"></a></p>
<ol>
<li>find the transpose of <strong><em>G</em></strong></li>
<li>print on display the element G<sub>13</sub> of the transpose of <strong><em>G</em></strong></li>
<li>print on display the second row of the transpose of <strong><em>G</em></strong></li>
<li>print on display the third column of the transpose of <em><strong>G</strong></em></li>
<li>find the determinant of <strong><em>G</em></strong></li>
</ol>
<h3>Exercise 9</h3>
<p>Create the following Matrices</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1869" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example3.png" alt="matlab-matrix-operation-example" width="158" height="158" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example3.png 158w, https://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example3-150x150.png 150w, https://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example3-50x50.png 50w" sizes="(max-width: 158px) 100vw, 158px" /></a></p>
<ol>
<li>Find the Matrix <strong><em>H+J</em></strong></li>
<li>Find the Matrix <strong><em>H * J</em></strong></li>
<li><a href="http://tutorial45.com/matrix-multiplication-matlab/">Multiply <strong><em>H</em></strong> by <strong><em>J</em></strong>, element-by-element</a></li>
</ol>
<h3>Exercise 10</h3>
<p>Solve the linear system of equations <strong><em>ax=b</em></strong> if</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1870" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example2.png" alt="matlab-matrix-operation-example" width="148" height="159"></a></p>
<h3>Exercise 11</h3>
<ol>
<li>Create a 1 x 5 vector with elements with random values</li>
<li>Use the &#8220;<em>for</em>&#8221; loop to find the greatest element of the matrix</li>
<li>Use the &#8220;<em>while</em>&#8221; loop to find the smallest element of the matrix</li>
</ol>
<h3>Exercise 12</h3>
<p>Use the <em>diag </em>operator to generate the matrix</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example4.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1874" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example4.png" alt="matlab-matrix-operation-example" width="176" height="104"></a></p>
<h3>Exercise 13</h3>
<p>Let&#8217;s consider the following vector</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example5.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1878" src="http://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example5.png" alt="matlab-matrix-operation-example" width="309" height="41" srcset="https://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example5.png 309w, https://tutorial45.com/wp-content/uploads/2015/07/matlab-matrix-operation-example5-300x40.png 300w" sizes="(max-width: 309px) 100vw, 309px" /></a></p>
<ol>
<li>Define a vector K, K being the vector A sorted in ascending order</li>
<li>Define a vector L, L being the <a href="http://tutorial45.com/matlab-sort-matrix/">vector A sorted in Descending order</a></li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/matlab-matrix-operations-exercises/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Solve Equations With Unknown Coefficients With Matlab</title>
		<link>https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/</link>
					<comments>https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andreea]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 13:48:00 +0000</pubDate>
				<category><![CDATA[MathLab]]></category>
		<guid isPermaLink="false">http://tutorial45.com/?p=2015</guid>

					<description><![CDATA[<p><a href="https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/">Solve Equations With Unknown Coefficients With Matlab</a></p>
<p>We have so far been working with numbers, totally ignoring one of the most rewarding ability Matlab put to our use: the possibility to work with symbolic expressions. In many college algebraic courses, it is taught how to use and simplify equations with symbolic expressions, where one of the major task is to be learn ... </p>
<p class="read-more-container"><a title="Solve Equations With Unknown Coefficients With Matlab" class="read-more button" href="https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/#more-2015" aria-label="More on Solve Equations With Unknown Coefficients With Matlab">Read more</a></p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/">Solve Equations With Unknown Coefficients With Matlab</a></p>
<p>We have so far been working with numbers, totally ignoring one of the most rewarding ability Matlab put to our use: the possibility to work with symbolic expressions.</p>
<p>In many college algebraic courses, it is taught how to use and simplify equations with symbolic expressions, where one of the major task is to be learn how to express one symbol with respect to others. Here we will attempt to use <a href="http://tutorial45.com/solving-polynomial-equations-using-matlab/">Matlab to solve some problems</a> we lately worked on using real numbers.</p>
<h2>Example 1</h2>
<p>Let&#8217;s consider the following equation</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2018" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab.png" alt="solve-equations-matlab" width="192" height="35"></a></p>
<p>We all know that this is second order polynomial equation and we know how to solve it. Let&#8217;s try using Matlab to solve this very equation as it is, assuming we don&#8217;t know what the value of the coefficients are.</p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>syms a b c x
f = a*x^2 + b*x + c
solve(f)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab5.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2024" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab5.png" alt="solve-equations-matlab" width="278" height="171"></a></p>
<p>Let&#8217;s ask Matlab to give us less difficulties reading the answer</p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>pretty(ans)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab6.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2025" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab6.png" alt="solve-equations-matlab" width="249" height="236"></a></p>
<p>Which we all remember from basic algebra.</p>
<p>If you would like to solve the equation with respect to a, you can state it like this</p>
<pre>solve(f,a)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab7.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2027" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab7.png" alt="solve-equations-matlab" width="155" height="95"></a></p>
<h2>Example 2</h2>
<p>Let&#8217;s now use the following equation</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab1.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2019" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab1.png" alt="solve-equations-matlab" width="244" height="34"></a></p>
<p>Just like the second order polynomial equation in example 1, this will be like it</p>
<p>The code</p>
<pre>syms a b c d x;
f = a*x^3 + b*x^2 + c*x + d;
l = solve(f);
pretty(l)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab8.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2028" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab8.png" alt="solve-equations-matlab" width="578" height="562" srcset="https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab8.png 578w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab8-300x292.png 300w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab8-50x50.png 50w" sizes="(max-width: 578px) 100vw, 578px" /></a></p>
<h2>Example 3</h2>
<p>This is also a nice method you can make use of, to help you remember a formula. Let&#8217;s consider the following Matrix</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2020" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab2.png" alt="solve-equations-matlab" width="203" height="75" srcset="https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab2.png 203w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab2-200x75.png 200w" sizes="(max-width: 203px) 100vw, 203px" /></a></p>
<p>Let&#8217;s find the determinant of A</p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>syms A11 A12 A13 A21 A22 A23 A31 A32 A33
A=[A11 A12 A13 ; A21 A22 A23 ; A31 A32 A33]
l = det(A)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab9.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2030" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab9.png" alt="solve-equations-matlab" width="556" height="86" srcset="https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab9.png 556w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab9-300x46.png 300w" sizes="(max-width: 556px) 100vw, 556px" /></a></p>
<h2>Example 4</h2>
<p>Let&#8217;s do <a href="http://tutorial45.com/matlab-matrix-operations/">some Matrix operation</a> with the following matrices: Addition and Multiplication.</p>
<h2><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab3.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2021" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab3.png" alt="solve-equations-matlab" width="302" height="51" srcset="https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab3.png 302w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab3-300x51.png 300w" sizes="(max-width: 302px) 100vw, 302px" /></a></h2>
<p><span style="text-decoration: underline;">the code</span></p>
<pre>syms B11 B12 B21 B22 C11 C12 C21 C22;
B = [B11 B12 ; B21 B22];
C = [C11 C12 ; C21 C22];
Add = B + C;
Mul = B*C;
Add
Mul</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab10.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2031" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab10.png" alt="solve-equations-matlab" width="331" height="200" srcset="https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab10.png 331w, https://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab10-300x181.png 300w" sizes="(max-width: 331px) 100vw, 331px" /></a></p>
<h2>Example 5</h2>
<p>Let&#8217;s end this session with solving the following equation.</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab4.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2022" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab4.png" alt="solve-equations-matlab" width="144" height="34"></a></p>
<p><span style="text-decoration: underline;">The code</span></p>
<pre>syms a b x
g = a^x + b;
l = solve(g);
pretty(l)</pre>
<p>Which returns</p>
<p><a href="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab11.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2035" src="http://tutorial45.com/wp-content/uploads/2015/07/solve-equations-matlab11.png" alt="solve-equations-matlab" width="114" height="64"></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorial45.com/solve-equations-with-unknown-coefficient-with-matlab/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: tutorial45.com @ 2026-06-05 00:07:33 by W3 Total Cache
-->