; 2012 | Michael Ian Lapsley

Save figures to PDF in MATLAB (or octave)

I used to use a program that someone developed called fig_setpdf.m, which gives some options about saving to a pdf. More recently I found that you can simply use the print command to generate a pdf. This does not give the options of fig_setpdf, but it can be easily implemented. (In fact that is how fig_setpdf works) Here is a simple example of how to create a pdf from the...

Notes on using the Latex PhD thesis template

Later I will add the getting started details. % It took me a while to get figures into the document. Tiff images cannot be used. Do not use spaces in the figure name. Here is the syntax: %%% \begin{figure}[htb] \centering \includegraphics[width = 5.8in]{Chapter-2/Figures/Figure_2-1.png} \caption{caption text.} \label{ChX-figure: FigureLabel} \end{figure} %%% % % I had to add:...

[Matlab] Figure and axis options

In Matlab, if you type get(gcf) of get(gca) you will get a list of the current properties of the given axis or figure. Also, set(gcf) or set(gca) will list all available properties and the legal options you can set. This is true for other objects also. I tend to use figures and axes regularly and forget these option and so I am listing them here. set(gcf):     Alphamap   ...

[Matlab] Colors and Symbols for ploting in loops

Sometimes it is easier to use a loop to plot something rather than manually typing plot many times. The problem is that all of the lines will have the same color and all the symbols will be the same. This code easily applies color to plots in a loop....

[Matlab] User Interface Functions

One easy method for creating a user interface is a question dialog. This can easily be used with the switch function to run different sections of code. SelectFunction = questdlg('What do you want to do?', ...                 'Select Function', ...                ...

[Matlab] Adding ASCII Charecters for abvanced ploting

Some times in Matlab one may want to add some charecter in the code. Here is an example: Lets say you want to plot several variables with similar names (like A1, A2, A3) using a for loop as such: A1 = 0:5; A2 = 5:10; A3 = 10:15;for i = 1:3    eval(['plot(A',num2str(i),')'])    hold on end This will work but all of your plots will have the same line type, symbol...