Category Archives: Code

Normalize values in a matrix to be between 0 and 1 (Matlab Tips)

I’m run a function in Matlab and it requires a matrix of variables within 0 and 1. The way to normalize the values to be between 0 and 1, and transform back to the original matrix as follows: b = … Continue reading

Posted in Code | Tagged , | Leave a comment

How to export string with timeperiod to .dat file? (Re-Post)

Here a¬†question (original link) that I ask at Matlab Community that the reader may found useful. Question: I have a large string that containing time period such as 23-May-2009 02:00:00 (as attached). Variable editor in Matlab is unable to display … Continue reading

Posted in Code | Tagged , | Leave a comment

Protected: R Programming (Code and Tutorial for Beginner)

There is no excerpt because this is a protected post.

Posted in Code | Enter your password to view comments.

Protected: Synthetic rainfall series using Poisson (Matlab Code)

There is no excerpt because this is a protected post.

Posted in Code, Hydrology | Tagged | Enter your password to view comments.

Simulating Poisson process in Matlab

Posted in Code | Tagged , , | Leave a comment

Split excel worksheets to individual files

If we have about many sheets in excel, and save all the sheets as their own files will definitely was not about to do this by hand. it take a take time!. I found a good tips from the internet, … Continue reading

Posted in Code | Tagged , | Leave a comment

Remove the last part of every line in notepad++

If we have the lines: http://lunar.earth.northwestern.edu/mediawiki/index.php/Limitless_It_the_film_high_quality http://sportnaslava.info/wiki/index.php?title=User:CisBlakeman861 and we want final lines become like this: http://lunar.earth.northwestern.edu/mediawiki/index.php http://sportnaslava.info/wiki/index.php we can applied notepad++ to do it. The solution as follow: 1) Using notepad++ and go to the search. Please used the regular … Continue reading

Posted in Code | Tagged | Leave a comment

(Repost) Batch Change/Rename File Extensions In Windows

A good tips from http://www.addictivetips.com/windows-tips/batch-change-rename-file-extensions-in-windows/. Please refer to the original article. ————————————————————————– Batch Change/Rename File Extensions In Windows Do you want to batch rename file extensions in one simple step? Changing each file extension separately can be a pain in … Continue reading

Posted in Code | Leave a comment

Grouping boxplot in matlab

Here an example from http://stackoverflow.com/questions/16267440/grouping-boxplot-matlab. The example is about on how to create a boxplot for multiple group of variables. The example as follows: x=rand(1000,6); %variable x y=rand(1000,6); %variable y D(:,1:2:12)=x; %rearrange x into d. D(:,2:2:12)=y; %rearrange y into d … Continue reading

Posted in Code | Tagged , | Leave a comment

Run for 100 times (loops) and save each result of run into a single matrix in MATLAB

Here a simple example: You want to run 100x times of this function, y=2i, where i is integer values (0¬†until 100) and you want to save each y into a single matrix (named as y1), you can write as follow: … Continue reading

Posted in Code | Tagged , | Leave a comment