Tutorial by Examples

The MATLAB Profiler is a tool for software profiling of MATLAB code. Using the Profiler, it is possible to obtain a visual representation of both execution time and memory consumption. Running the Profiler can be done in two ways: Clicking the "Run and Time" button in the MATLAB GUI...
The widely used combination of tic and toc can provide a rough idea of the execution time of a function or code snippets. For comparing several functions it shouldn't be used. Why? It is almost impossible to provide equal conditions for all code snippets to compare within a script using above solu...
Overview: The default data type for numeric arrays in MATLAB is double. double is a floating point representation of numbers, and this format takes 8 bytes (or 64 bits) per value. In some cases, where e.g. dealing only with integers or when numerical instability is not an imminent issue, such high ...
In some cases we need to apply functions to a set of ND-arrays. Let's look at this simple example. A(:,:,1) = [1 2; 4 5]; A(:,:,2) = [11 22; 44 55]; B(:,:,1) = [7 8; 1 2]; B(:,:,2) = [77 88; 11 22]; A = ans(:,:,1) = 1 2 4 5 ans(:,:,2) = 11 22 44 55 >&...
Arrays in MATLAB are held as continuous blocks in memory, allocated and released automatically by MATLAB. MATLAB hides memory management operations such as resizing of an array behind easy to use syntax: a = 1:4 a = 1 2 3 4 a(5) = 10 % or alternatively a = [a, 10] a = ...

Page 1 of 1