dimanche 20 novembre 2011

lancer matlab sur ubuntu 11.10

Je viens d'installer Matlab 2010a sur mon ubuntu  oneiric, mais au moment du lancement j'obtiens le message d'erreur suivant:
/usr/local/matlabR2010a/bin/util/oscheck.sh: 605: /lib/libc.so.6: not found
pour résoudre ce problème, il faudrait restaurer la librairie qui a été désinstallée durant la mise à jour d'ubuntu.  Pour ce faire, taper dans un terminal la commande suivante:
sudo ln -s /lib/i386-linux-gnu/libc-2.13.so /lib/libc.so.6
Et voilà :)

samedi 5 novembre 2011

Matlab: passing an input argument to a script

Assalamo 3alaykom :)

So, I had this routine to run in matlab and I got tired  copying and pasting all the code and then change the values of my variables, so I had to find an easy way  to get trough with this...the solution was clear and trivial just pass your variables as input argument to the script!!! Why didn't  think of it earlier :-/
Then came the syntax problem how do i do this in matlab?
After a quick google search this is what I found:
assume that we want to calculate "sqrt(x)", our script will look like this:
now we have 2 ways to pass the argument "x" to the script:

1- just type the value of "x" in the command window before running the script:

2- or, convert the script to a function by adding the folowing line to the beginning of your script:function y=scriptFileName(x)
then run your function on the command window as follows:
>> scriptFileName(36)

That's it: easy peasy lemon squeezy

mardi 12 juillet 2011

Matlab 7.0.1 R14 SP1, Error Starting Desktop

I needed to use Matlab 7.0.1 for my thesis work, and according to my supervisor this version is more handy and stable than the other newer versions. So I installed it on my Windows 7 virtual machine, the installation went well, but when I tried to lunch it, I had this "Error Starting Desktop” message followed by a huge Java stack. 

As usual, I googled it and voila, it seems that it's all a compatibility problem. All I needed to do is set he compatibility mode to Windows 2000 or install the Win2000VersionLie Fix.  

Hope this helps :)