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.
Wednesday, February 27, 2008
Thursday, February 21, 2008
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.
Tuesday, February 19, 2008
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]'
Tuesday, February 12, 2008
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.
Saturday, February 9, 2008
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)