Tag Archives: matlab

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

Simulating Poisson process in Matlab

Posted in Code | Tagged , , | 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

Read/edit the built-in Matlab functions

I found a good tip from the matlab community to find out the built-in function in Matlab. You can edit and change it. The tip as follows: % You can use the [which] command to find the path name to … Continue reading

Posted in Code | Tagged , , | Leave a comment