Category:Programming language:MATLAB

From LiteratePrograms
Jump to: navigation, search

If you need help from other users with a program written in MATLAB, take a look at Category:Users:MATLAB:Experts, Category:Users:MATLAB:Knows, and possibly Category:Users:MATLAB:Some.

MATLAB is a programming language distributed by The MathWorks. The opensource language Octave is mostly compatible with MATLAB.

Please note that the name of this language is "MATLAB", unhyphenated in all-upper case, not "matlab", "MAT-LAB" or "MATHLAB".


[edit] A structured view of the articles

[edit] Tips and Tricks

A lot of tricks in MATLAB are targeted to avoid loops using linear algebra or matrices manipulations. A very good tutorial to such tricks in MATLAB array manipulation tips and tricks, by Peter J. Acklam.

[edit] Simple example: Count occurences

Example: counting occurences in an array.

function frequency_table = count_elements(vectr)
% COUNT_ELEMENTS - fast and efficient way to count different 
%  elements in an array of integers.
% Example:
%  v = round(rand(300,1)*20);
%  f = count_elements(v)
% See also sparse 
[keys,idx,jdx]  = unique(vectr);
frequency_table = struct('keys',keys,'value',sparse(jdx,1,1));

[edit] Remove diagonal elements

Following an interesting answer on the newsgroup.


[edit] Literate Programming

  • The section Literate programming tools (MATLAB) gives some MATLAB code to be used with, with a special OCAMAWEB Lite version in MATLAB.
  • OCAMAWEB is a free Literate Programming tool for MATLAB and some other languages.

[edit] External links



This category has only the following subcategory.