Saturday, November 22, 2008

Exporting Simulink models to eps or other formats

To export Simulink models/block diagrams to eps or other image formats is easy. First, open your model. Next, use the print function to export to other formats (note the letter 's' that must precede the model name, which is entered without the '.mdl' postfix):
print -s<modelname> -d<xxx> -r<resolution> <filename.xxx>
For example, to export simmodel.mdl to eps with a resolution of 300 dpi, type
print -ssimmodel -deps -r300 simmodel.eps
The file simmodel.eps will be created in the directory where the command is entered.

For more information about image formats and print options, type
help print
Enjoy!

Friday, November 14, 2008

Adding difficult code snippets to your blog

It is sometimes difficult to add code snippets your blog, for example using Blogger/Blogspot. Code involving xml or html tags might get parsed if you simply try to use the <pre> tag. A simple solution is to copy and paste your code snippet into this website, which transforms it to "readable" code. You may then enclose the resulting code in <pre> tags as usual.

For example, when I needed to write <pre> in the previous paragraph, I went to the above website, entered <pre>, and got &lt;pre&gt; back in return, which I simply copy and pasted back into the Blogger editor.

Touchpad not working after upgrading to Ubuntu Intrepid

If you find that your laptop touchpad is not working after upgrading to Ubuntu 8.10 Intrepid, it may be that your SHMConfig is not enabled.  The official instructions are to open a terminal and enter the following command:
gksudo gedit /etc/hal/fdi/policy/shmconfig.fdi
Then put this into the file (which was empty in my case):
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>
After a reboot, your touchpad is hopefully working again. Also, you should have a Touchpad entry in the System menu: System -> Preferences -> Touchpad