<?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>Mathematical Engineering</title>
	<atom:link href="http://www.mathengineering.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mathengineering.com</link>
	<description>MATLAB Consulting, MATLAB Application Development, M-file Optimization &#38; Mathematics Engineering</description>
	<lastBuildDate>Mon, 23 Jan 2012 22:35:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Understanding Sparse Matrix Storage</title>
		<link>http://www.mathengineering.com/understanding-sparse-matrix-storage</link>
		<comments>http://www.mathengineering.com/understanding-sparse-matrix-storage#comments</comments>
		<pubDate>Thu, 09 Dec 2010 07:01:44 +0000</pubDate>
		<dc:creator>matlabguru</dc:creator>
				<category><![CDATA[Sparse]]></category>
		<category><![CDATA[sparse]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=202</guid>
		<description><![CDATA[Sparse matrices are powerful tools that can be used to save memory when processing and storing matrices that contain a lot of zero values. Within a sparse matrix, only the non-zero values are stored which can mean significant memory savings. For example, a 501-by-501 tri-diagonal matrix contains 251,001 values as a full matrix while it&#8230; <a class="continue_reading" href="http://www.mathengineering.com/understanding-sparse-matrix-storage">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Sparse matrices are powerful tools that can be used to save memory when processing and storing matrices that contain a lot of zero values.  Within a sparse matrix, only the non-zero values are stored which can mean significant memory savings.  For example, a 501-by-501 tri-diagonal matrix contains 251,001 values as a full matrix while it only contains 1,500 non-zero values when stored as sparse.  There is some overhead to the sparse storage format but in general it is small relative to the savings of not storing the zero values.<sup>1</sup></p>
<h2><a name="tuple"></a>3-Tuple storage</h2>
<pre><code>&gt;&gt; sparse(diag(0:3))
ans =

   (2,2)        1
   (3,3)        2
   (4,4)        3</code></pre>
<p>As is evident from the display format for a sparse matrix, the non-zero values in the matrix are stored as (i,j,value) tuples. The zero elements are implied &#8212; anything not stored is treated as a zero.</p>
<p>The <code>find</code> function and the <code>sparse</code> function work directly with these tuples</p>
<ul>
<li><code>[i,j,v] = find(S)</code> returns the truple row, column and value values as separate arrays.</li>
<li><code>S = sparse(i,j,v)</code> reconstructs the sparse array from the tuple values.</li>
</ul>
<p>and can be used to switch back and forth between the tuple and the sparse matrix.  The tuple format is a particularly compact way of representing sparse data and can be easily written to files that can be read by MATLAB and other data analysis packages.</p>
<h2>Column oriented storage</h2>
<p>The sparse storage format is optimized for column-oriented operations which can be important to understand when crafting m-files that use the sparse matrix.  This can be especially true when working with huge matrices where the orientation of a matrix has a big effect on processing speed or memory requirements.  The following figure illustrates the sparse storage approach used within MATLAB.</p>
<p style="text-align: center">
<p style="text-align: center"><img class="size-full wp-image-260 aligncenter" src="http://www.mathengineering.com/wp-content/uploads/sparse-matrix-storage.gif" alt="MATLAB sparse matrix storage scheme" width="480" height="440" /></p>
<p>A column spine contains pointers to the elements in each column.  In addition, the elements in the column are stored in row sorted order to improve the search time for a particular (row,col) element. Columns without elements contain a pointer to an empty column list.</p>
<p>This has several implications when working with the sparse matrix.</p>
<ol>
<li>The column size of the matrix <code>size(S,2)</code> is significant since a column pointer  is created for a column even if there are no elements in that column.</li>
<li>The row size of the matrix <code>size(S,1)</code> has no impact on the amount of memory used by the sparse matrix.</li>
<li>Rows that contain only zeros take up no space.</li>
<li>Accessing the columns of a sparse matrix is faster than accessing the rows of a sparse matrix.</li>
</ol>
<p>The ramifications of these implications are that we should prefer algorithms that operate on the columns of sparse matrices and that orient the matrix so that there are less columns than rows.</p>
<p class="note"><sup>1</sup>You can use the <code>whos</code> command to determine the actual memory allocated to a sparse matrix.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/understanding-sparse-matrix-storage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sparse and Automatic Accumulation</title>
		<link>http://www.mathengineering.com/sparse-and-automatic-accumulation</link>
		<comments>http://www.mathengineering.com/sparse-and-automatic-accumulation#comments</comments>
		<pubDate>Thu, 09 Dec 2010 07:00:50 +0000</pubDate>
		<dc:creator>matlabguru</dc:creator>
				<category><![CDATA[Sparse]]></category>
		<category><![CDATA[accumarray]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[MATLAB trick]]></category>
		<category><![CDATA[sparse]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=271</guid>
		<description><![CDATA[The sparse function is normally used to create sparse matrices but it has a trick up its sleeve!  This post reveals one of my favorite MATLAB tricks. When used with the tuple syntax, sparse(i,j,v) or sparse(i,j,v,m,n), any repeated (i,j) elements are automatically accumulated! In other words, the sparse function automatically sums any values that are&#8230; <a class="continue_reading" href="http://www.mathengineering.com/sparse-and-automatic-accumulation">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>The <code>sparse</code> function is normally used to create sparse matrices but it has a trick up its sleeve!  This post reveals one of my favorite MATLAB tricks.</p>
<p>When used with the <a href="understanding-sparse-matrix-storage#tuple"><em>tuple syntax</em></a>, <code>sparse(i,j,v)</code> or <code>sparse(i,j,v,m,n)</code>, any repeated (i,j) elements are automatically accumulated!  In other words, the <code>sparse</code> function automatically sums any values that are assigned to the same location.</p>
<p>This is in contrast to normal array assignment where a statement like</p>
<pre><code>A(i+(j-1)*m) = v;
</code></pre>
<p>(for a full array A) overwrites any repeated elements (leaving only the last value assigned in that spot).</p>
<p>The accumulation behavior can be used in some cases to enhance performance.   For example, the following code uses <code>sparse</code> to compute the image histogram for an indexed image (the code also displays the histogram counts as a bar chart).</p>
<pre><code>% Load one of the MATLAB demo images.
% The mat-file contains:
%   X   - the index image matrix
%   map - its colormap
load durer
counts = sparse(1,X,1);
bar(counts)
</code></pre>
<p>By mapping all the image values to a single row, the accumulation feature of <code>sparse</code> automatically computes the histogram counts!</p>
<h2>accumarray</h2>
<p>Current versions of MATLAB also contain a function called <code>accumarray</code> that performs the accumulation trick for non-sparse matrices (and you can change the accumulation function too).  The <code>accumarray</code> function is even more powerful than <code>sparse</code> because it includes options to set the fill value to something other than zero and it handles cell arrays too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/sparse-and-automatic-accumulation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Mathematical Engineering?</title>
		<link>http://www.mathengineering.com/what-is-mathematical-engineering</link>
		<comments>http://www.mathengineering.com/what-is-mathematical-engineering#comments</comments>
		<pubDate>Thu, 18 Nov 2010 23:37:31 +0000</pubDate>
		<dc:creator>Clay M. Thompson</dc:creator>
				<category><![CDATA[MATLAB Consulting]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=206</guid>
		<description><![CDATA[Simply put, mathematical engineering is an approach to solving engineering problems that primarily uses mathematics and software. At Mathematical Engineering™ we refer to this as Engineering with Software. Typical applications of mathematical engineering involve mathematical analysis, mathematical modeling, simulations and visualization techniques (including creating specialized user interfaces or GUI&#8217;s) that help engineers and researchers do&#8230; <a class="continue_reading" href="http://www.mathengineering.com/what-is-mathematical-engineering">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Simply put, mathematical engineering is an approach to solving engineering problems that primarily uses mathematics and software.  At Mathematical Engineering™ we refer to this as <a href="engineering-with-software"><em>Engineering with Software</em></a>.</p>
<p>Typical applications of mathematical engineering involve mathematical analysis, mathematical modeling, simulations and visualization techniques (including creating specialized user interfaces or GUI&#8217;s) that help engineers and researchers do their jobs.</p>
<p>Here at Mathematical Engineering™ (the consulting company), we do all these things to help our clients solve problems and achieve their goals. In addition, we focus on approaches that make our clients <a href="performance-optimization-service">more productive</a> by improving the run-time performance and/or the quality of the solutions the software achieves.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/what-is-mathematical-engineering/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Engineering With Software</title>
		<link>http://www.mathengineering.com/engineering-with-software</link>
		<comments>http://www.mathengineering.com/engineering-with-software#comments</comments>
		<pubDate>Thu, 18 Nov 2010 00:03:47 +0000</pubDate>
		<dc:creator>Clay M. Thompson</dc:creator>
				<category><![CDATA[MATLAB Consulting]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=51</guid>
		<description><![CDATA[At Mathematical Engineering™ we use software and mathematics to create trouble-free custom solutions for your business. We can assist with analyzing your results, speeding up your m-files or creating a sophisticated mathematical model. We can create visualization tools to help you gain insights or a graphical user interface (GUI) to automate your investigations. With specializations&#8230; <a class="continue_reading" href="http://www.mathengineering.com/engineering-with-software">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mathengineering.com/?attachment_id=131"><img class="alignright size-thumbnail wp-image-131" title="custom-user-interface" src="http://www.mathengineering.com/wp-content/uploads/custom-user-interface-150x111.gif" alt="MATLAB GUI Example" width="150" height="111" /></a>At Mathematical Engineering™ we use software and mathematics to create trouble-free custom solutions for your business. We can assist with analyzing your results, speeding up your m-files or creating a sophisticated mathematical model.  We can create visualization tools to help you gain insights or a graphical user interface (GUI) to automate your investigations. With specializations in engineering and mathematics as well as MATLAB, iPhone, Palm OS and Windows Mobile, we make math work for you.</p>
<h2><a href="http://www.mathengineering.com/?attachment_id=133"><img class="alignright size-thumbnail wp-image-133" title="Example Custom Plot" src="http://www.mathengineering.com/wp-content/uploads/custom-plot-150x112.gif" alt="Custom candle chart" width="150" height="112" /></a>MATLAB Consulting</h2>
<p>Our principal, Dr. Clay M. Thompson, provides expert MATLAB consulting to our clients.  With engineering degrees from M.I.T and Stanford University and over 25 years working with MATLAB, Dr. Thompson can create the software you need to solve engineering problems.  Here is a sample of the types of services we have provided to our clients:</p>
<ul>
<li>MATLAB m-file speed-up and optimization</li>
<li>Convert m-files to C/C++</li>
<li>Mathematical modeling and visualization</li>
<li>Mathematical analysis</li>
<li>Model building</li>
<li>Numerical optimization</li>
<li>Algorithm development</li>
<li>Create specialized graphs and charts</li>
</ul>
<p>See our <a href="matlab-consulting">MATLAB Consulting</a> page for more details.</p>
<h2>Custom Software Development</h2>
<p>We offer complete, end-to-end development services and can leverage multiple platforms, languages and operating systems to achieve your goals</p>
<ul>
<li>Software architecture and design</li>
<li>MATLAB toolbox development</li>
<li>MATLAB GUI development</li>
<li>Create specialized m-files</li>
<li>Create standalone applications that run on mobile devices or on the desktop.</li>
</ul>
<p>See our <a href="custom-software-development">Custom Software Development</a> page for more details.</p>
<h2>MATLAB Guru blog</h2>
<p>Learn how to get the most out of MATLAB. Our <a href="../category/MATLAB">articles</a> reveal some of the MATLAB tricks and techniques we use everyday to help our clients optimize their use of MATLAB.</p>
<h2>Contact Us</h2>
<p>To inquire about our services without obligation, please contact Dr. Clay Thompson using our <a href="../contact">Contact Form</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/engineering-with-software/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expert MATLAB Consulting</title>
		<link>http://www.mathengineering.com/matlab-consulting</link>
		<comments>http://www.mathengineering.com/matlab-consulting#comments</comments>
		<pubDate>Wed, 17 Nov 2010 23:09:14 +0000</pubDate>
		<dc:creator>Clay M. Thompson</dc:creator>
				<category><![CDATA[MATLAB Consulting]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=151</guid>
		<description><![CDATA[Dr. Clay M. Thompson is one of the world&#8217;s foremost MATLAB programmers. He knows MATLAB inside and out, and specializes in using MATLAB to develop cost-effective, custom, proprietary applications for our clients. Dr. Thompson worked at The MathWorks, Inc. (the makers of MATLAB) for 9 years developing toolboxes and writing m-files. He was the chief&#8230; <a class="continue_reading" href="http://www.mathengineering.com/matlab-consulting">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_199" class="wp-caption alignright" style="width: 144px"><img class="size-full wp-image-199" title="Dr. Clay M. Thompson" src="http://www.mathengineering.com/wp-content/uploads/clay10.jpg" alt="Dr. Clay M. Thompson, founder Mathematical Engineering" width="134" height="189" /><p class="wp-caption-text">Dr. Clay M. Thomposn, founder Mathematical Engineering</p></div>
<p>Dr. Clay M. Thompson is one of the world&#8217;s foremost MATLAB programmers. He knows MATLAB inside and out, and specializes in using MATLAB to develop cost-effective, custom, proprietary applications for our clients.</p>
<p>Dr. Thompson worked at The MathWorks, Inc. (the makers of MATLAB) for 9 years developing toolboxes and writing m-files. He was the chief language designer for MATLAB 5.0 (the version of MATLAB that introduced multi-dimensional arrays, cell arrays, and MATLAB objects). In 1999, he left The MathWorks and began providing MATLAB consulting services.</p>
<p>Over the years, Dr. Thompson has written thousands of m- and MEX-files. If you use MATLAB, you have probably used many of the m- and mex-files he created. He is the author of the Image Processing Toolbox and a co-author of the Control Toolbox as well as many of the functions in the MATLAB toolbox itself.  His intimate knowledge of MATLAB allows him to produce optimized m-files that run very fast.</p>
<p>For general descriptions of types of solutions we have created for our clients, see the <a href="../matlab-case-studies">Case Studies</a> page.</p>
<p>We provide the following types of services:</p>
<h2>Custom Software Development</h2>
<ul>
<li>Create a custom, proprietary application for you using MATLAB</li>
<li>Create MATLAB GUI&#8217;s so you can visually interact with your data</li>
<li>Deploy MATLAB algorithms outside of MATLAB</li>
<li>Port your MATLAB code to C/C++</li>
</ul>
<h2>M-File Performance Optimization</h2>
<ul>
<li>Optimize your m-files so that they run faster and use less memory.</li>
<li>Create or update m-files to handle large data sets</li>
</ul>
<h2>Data Analysis and Visualization</h2>
<ul>
<li>Analyze data to extract  information, find trends and patterns</li>
<li>Create specialized graphs and plots using Handle Graphics</li>
<li>Algorithm development</li>
<li>Create simulation models from equations or empirical data</li>
<li>Apply numerical optimization algorithms to solve problems</li>
</ul>
<h2>M-file Programming</h2>
<ul>
<li>Develop or implement an algorithm in MATLAB</li>
<li>Create special data import functions to read your data formats</li>
<li>Create specialized graphs and plots using Handle Graphics</li>
<li>Create a special MATLAB-based toolbox for your solution</li>
</ul>
<h2>Advice and training</h2>
<ul>
<li>Help you use MATLAB and MATLAB toolboxes more productively</li>
<li>Help you solve problems using MATLAB</li>
<li>Debug m-files that are not working properly</li>
</ul>
<p>Our goal is to make you more productive using MATLAB. We can consult with you on how to use MATLAB more effectively, or we can develop and implement custom solutions for you. Either way, we help you get the most out of MATLAB.</p>
<h2>Contact Us</h2>
<p>To inquire about our services without obligation, please contact Dr. Clay Thompson using our <a href="../contact">Contact Form</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/matlab-consulting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>M-File Performance Optimization</title>
		<link>http://www.mathengineering.com/performance-optimization-service</link>
		<comments>http://www.mathengineering.com/performance-optimization-service#comments</comments>
		<pubDate>Wed, 17 Nov 2010 22:17:32 +0000</pubDate>
		<dc:creator>Clay M. Thompson</dc:creator>
				<category><![CDATA[MATLAB Consulting]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=81</guid>
		<description><![CDATA[MATLAB m-file optimization is one of our most popular services. We offer a risk-free guarantee of at least a 200% performance improvement. Our principal, Dr. Clay Thompson, has been optimizing m-files for years, often achieving a speed improvement for a collection of m-files of 400% or more. In some cases, we have even increased performance&#8230; <a class="continue_reading" href="http://www.mathengineering.com/performance-optimization-service">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mathengineering.com/wp-content/uploads/m-file-optimization.gif"><img class="alignright size-thumbnail wp-image-132" title="M-file speed up results" src="http://www.mathengineering.com/wp-content/uploads/m-file-optimization-150x108.gif" alt="M-file speed-up results" width="150" height="108" /></a>MATLAB m-file optimization is one of our most popular services.  We offer a risk-free guarantee of at least a 200% performance improvement. </p>
<p>Our principal, Dr. Clay Thompson, has been optimizing m-files for years, often achieving a speed improvement for a collection of m-files of 400% or more. In some cases, we have even increased performance by  4000%!  </p>
<p>There are a few requirements. If your problem fits those requirements, just <a href="contact">contact us</a> and let us know you want to take advantage of the performance optimization service. If your problem is too big, uses other toolboxes or doesn&#8217;t meet the requirements below, then contact us for a no-obligation estimate.</p>
<h2>Requirements</h2>
<ul>
<li><strong>Top Level Script.</strong> You must provide a script that calls the m-files with test data. We will use this test data and script to verify that our changes to speed up your m-files did not change the results within acceptable tolerances. Your script should run in a reasonable amount of time (between 5 and  20 minutes) but can contain as many test cases as you require.</li>
<li><strong>Description.</strong> You must provide a  description of what your m-files are trying to accomplish.</li>
<li><strong>Self-Contained.</strong> The m-files you submit must be self contained in that they can only rely on MATLAB and our supported MathWorks&#8217; Toolboxes. If your m-files rely on a non-supported MathWorks&#8217; Toolbox, there will be an additional fee for each unsupported toolbox so we can get a license to those toolboxes.</li>
<li><strong>Not too big.</strong> The total number of lines of code within all the m-files you submit must be less than 250.</li>
</ul>
<h2>Supported MATLAB Toolboxes</h2>
<ul>
<li>Optimization Toolbox</li>
<li>Financial Toolbox</li>
<li>Signal Processing Toolbox</li>
<li>Image Processing Toolbox</li>
<li>Control Toolbox</li>
</ul>
<h2>Contact Us</h2>
<p>To inquire about our services without obligation, please contact Dr. Thompson using our <a href="contact">Contact Form</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/performance-optimization-service/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Development for Mobile Devices</title>
		<link>http://www.mathengineering.com/software-development-for-mobile-devices</link>
		<comments>http://www.mathengineering.com/software-development-for-mobile-devices#comments</comments>
		<pubDate>Wed, 17 Nov 2010 21:19:48 +0000</pubDate>
		<dc:creator>Clay M. Thompson</dc:creator>
				<category><![CDATA[Mobile Apps]]></category>

		<guid isPermaLink="false">http://www.mathengineering.com/?p=84</guid>
		<description><![CDATA[Dr. Clay Thompson has been writing software for mobile devices since 1998. He has created many custom applications for our clients. See our mobile solutions page for examples. We can help you develop software specifically for your needs. We can work from your specifications or create a product to solve a specific problem or to&#8230; <a class="continue_reading" href="http://www.mathengineering.com/software-development-for-mobile-devices">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-136" href="http://www.mathengineering.com/software-development-for-mobile-devices/skyguide"><img class="alignright size-full wp-image-136" src="http://www.mathengineering.com/wp-content/uploads/skyguide.png" alt="Skyguide Airline Timetable for Palm OS" width="145" height="305" /></a>Dr. Clay Thompson has  been writing software for mobile devices since 1998. He has created many custom applications for our clients. See our <a href="mobile-solutions">mobile solutions</a> page for examples.</p>
<p>We can help you develop software specifically for your needs. We can work from your specifications or create a product to solve a  specific problem or to address a particular market. We develop both in-house software and software suitable for commercial distribution. We can develop software from scratch or make improvements to source code you already have. In all cases, we focus on creating high quality bug-free software.</p>
<h2>Palm OS, Windows Mobile and iPhone</h2>
<p>We excel at creating full end-to-end solutions for our clients.  We can leverage<br />
Palm OS, iPhone, Windows Mobile, Unix, Windows and Macintosh environments as necessary to make sure your application does everything you need it to do.</p>
<h2>Consulting Services</h2>
<ul>
<li>Custom Application Development</li>
<li>Software Architecture and Design</li>
<li>Custom Programming</li>
<li>Software Optimization</li>
</ul>
<h2>Platforms Supported</h2>
<ul>
<li>iPhone</li>
<li>Palm OS and webOS</li>
<li>Windows XP and Windows Mobile</li>
<li>Mac OS X</li>
<li>Web applications (including AJAX-based applications)</li>
<li>MATLAB</li>
</ul>
<h2>Contact Us</h2>
<p>In inquire about our services without obligation, please contact Dr. Clay Thompson using our <a href="contact">Contact Form</a>.</p>
<p class="note">The   airline timetable application shown above was created for one of our clients and licensed to American Express. Skyguide a a trademark of American Express.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathengineering.com/software-development-for-mobile-devices/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

