Marcelo's Blog

cicconet [at] gmail [dot] com

Archive for the ‘Code Snippets’ Category

Progress Bar in Matlab

leave a comment »

Link.

Written by Marcelo Cicconet

May 17, 2012 at 3:41 PM

Posted in Code Snippets

Matlab “parfor”

leave a comment »


matlabpool open
parfor _____
_____
end
matlabpool close

…..

Check it out! See help parfor for details.

Written by Marcelo Cicconet

May 16, 2012 at 2:44 PM

Posted in Code Snippets

Angle of 2D Vector

leave a comment »

Trivial, but convenient, this Matlab function gives the angle of a vector in 2D:

function a = ang(x,y)
n = sqrt(x^2+y^2);
if n == 0
a = 0;
else
c = x/n;
if y >= 0
a = acos(c);
else
a = 2*pi-acos(c);
end
end
end

Written by Marcelo Cicconet

February 16, 2012 at 7:27 PM

Posted in Code Snippets