Hi people, today there is a very interesting post on a matlab central's blog. it describes how you can open a dialog to choose a file from the command line, and use it in some scripts.
the video is here.
enjoy!
Wednesday, February 27, 2008
open dialog to "open file" in matlab
Posted by otmezger at 8:20 AM 0 comments
Labels: matlab
Thursday, February 21, 2008
calculate min/max in matlab excluding the zeros
the problem is how to calculate the minimum of a vector excluding the zeros?
here is an example how to do that:
Posted by otmezger at 10:06 AM 0 comments
Labels: matlab
about logical indexing
Today, M-Lint was telling me that "logical indexing is usually faster than FIND".
I didn't knew what logical indexing means. a short google search and i found this out:
if you want to perform the following operation:
you can optimize it just by omitting the find command just like this:
. Matlab is just capable to handle the "logical indexing" which means the indexes of the vector that match the conditions.
Posted by otmezger at 8:17 AM 5 comments
Labels: m-lint, matlab, speeding up code
Tuesday, February 19, 2008
how to turn a matrix into a single vector with matlab
hi, if you are trying to transform a matrix into a single vector you sould't use if's.
there is a very easy way to do that.
if your matrix a = [1 2 3; 4 5 6], the command b=a(:) will generate a matrix b that looks like this: [1 4 2 5 3 6]'
Posted by otmezger at 11:44 AM 0 comments
Labels: matlab
Tuesday, February 12, 2008
use profiler to improve code
there is a very cool application in matlab to help you improve the code. it is called "profiler".
let me give you an example. If you have a script named "name_of_script.m", you can enter the following commands to check it:
at the end, you'll get a new windows, where you can find which section of the script is the bottleneck.
happy coding!
Posted by otmezger at 12:54 PM 0 comments
Labels: matlab, speeding up code
improving matlab code to run faster
improve matlab code to run faster... that's the question. i found a very cool document on the web. you can find it here.
Posted by otmezger at 11:59 AM 0 comments
Labels: matlab-tutorials
List of Matlab tutorials and Howtos
Great list of matlab tutorials and howtos.
you can find it here
Posted by otmezger at 10:30 AM 0 comments
Labels: matlab, matlab-tutorials
Saturday, February 9, 2008
function in matlab to convert 1/4-h vectors to 1-h vector
sometime i have to handle with large data vectors, which are time measurements. One value each 15 Min.
For the analysis, i can use 1 value per hour. to convert the vectors i use the following function:
function DATout = convert_15min_1h(DATin)
size_15min=length(DATin);
size_1h=size_15min/4;
DATout=zeros(size_1h,1);
for i=1:1:size_1h
von=(i-1)*4+1;
bis=(i)*4;
DATout(i)=sum(DATin(von:bis))/4;
end
Posted by otmezger at 9:08 AM 0 comments
Labels: matlab
Friday, February 8, 2008
Zeilenabstand in LaTeX
um in LaTeX den Zeilenabstand zu ändern, z.b. von 1,5 auf 1,0 oder sogar 1,25, benutzt man diesen Kommando im prämble:
Posted by otmezger at 4:18 PM 0 comments
Labels: latex