Doug's MATLAB Video Tutorials

December 20th, 2010

Tradeoffs: Code complexity vs data storage

This video discusses a code tradeoff of increasing code complexity so that less data needed to be stored. This video discusses how for small cases, code complexity often rules over other considerations. However, in this case, the memory requirements grow a the cube of the size of a matrix, so quickly the code complexity must be sacrificed.

2 Responses to “Tradeoffs: Code complexity vs data storage”

  1. Anootnara replied on :

    If i have a data set of 5000 rows and 14 columns, what command(s) should I use if I want to find the average of all five thousands rows across columns 7-10.

    Thank you,
    Toon

  2. dhull replied on :
    mat = rand(5000,14);
    subMatrix = mat(:,7:10);
    avg = mean(subMatrix(:));
    

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


MathWorks

Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

Doug's picture

These postings are the author's and don't necessarily represent the opinions of The MathWorks.