This script plots two sets of 1D data on the same figure with two separate axis and with the same gridding.
The code also checks if the x-axis data are the same, if the x-axis data
are not the same, it draws an additional x-axis on the top of the figure.
The two sets of data with their axes are drawn with two colors for ease of reading
Hi Jan. Thanks for the constructive comment.You are right(in all of what you said). This function is very similar to plotyy, yet people are always asking about this, and for some reason, it is easier to find these files on Matlab central than Matlab help.
"[0:.3:40]" is less efficient than "0:.3:40".
It might be helpful to mention Matlab's built-in PLOTYY in a "See also" line, because it does almost the same.