Affichage des articles dont le libellé est Matlab. Afficher tous les articles
Affichage des articles dont le libellé est Matlab. Afficher tous les articles

mardi 29 avril 2014

how to install matlab on Ubuntu 12.04

I had several issues trying to install matlab R2010a on my ubuntu 12.04 and I don't want anyone to go through the troubles I got in so this is how you do it:

1. if you have your Matlab in an iso file don't use "Furius iso mount" to mount it. if you do so you will have permissions issues. Instead, mount it the old school way:
  • sudo mkdir /media/matlab 
  • sudo mount matu2k8a.iso /media/matlab/ -t iso9660 -o loop
2. Create a base directory for Matlab manually:
  •  sudo mkdir /usr/local/matlab
3.  Go to where the ISO is mounted and run the installer:
  • sudo ./install
Give the path of the directory we’ve already created for the Matlab base directory. Give the serial key when prompted.


4. for activating Matlab go to the bin directory in the Matlab base directory /usr/local/matlab and run the command:
  • sudo ./activate_matlab.sh
5. After the setup is completed, don’t start Matlab. Create a .matlab directory in your home and give user permissions.
  • mkdir ~/.matlab
  • sudo chown -R ${USER}:${USER} ~/.matlab
Done :) Now you can run Matlab using the command:
  • sh /usr/local/matlab/bin/matlab

jeudi 27 septembre 2012

Setting-up Matlab R2010a compiler

Salamo3alaykom,

If you're using Matlab R2010a on Win7, you're probably getting an issue with the C++ compiler using mex command.
So to overcome this issue you have to get a compatible compiler installed, you can check all the compatible C++ compilers here.
I had the Visual Studio 2008 installed and thenin the matlab command window I run the msbuild command to set-up the C/ C++ compiler to be used with MATLAB.
So, you shoulget something like this:

>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:

Would you like mbuild to locate installed compilers [y]/n? y

Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\MATLAB\R2010a\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in C:\Program Files\Microsoft Visual Studio 9.0

[0] None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C++ 2008 SP1 
Location: C:\Program Files\Microsoft Visual Studio 9.0

Are these correct [y]/n? y

****************************************************************************
  Warning: Applications/components generated using Microsoft Visual Studio  
           2008 require that the Microsoft Visual Studio 2008 run-time      
           libraries be available on the computer used for deployment.      
           To redistribute your applications/components, be sure that the   
           deployment machine has these run-time libraries.                 
****************************************************************************

Trying to update options file: C:\Users\bouchratoune\AppData\Roaming\MathWorks\MATLAB\R2010a\compopts.bat
From template:              C:\MATLAB\R2010a\bin\win32\mbuildopts\msvc90compp.bat

Done . . . 


I hope that was helpful, and good luck with Matlab :D

 

dimanche 18 mars 2012

Using the 3GB Switch on Windows 7

I was running a routine under matlab and suddenly I got the infamous "Out of memory error".
So, as usual :p, I googled the problem and found that I needed to use the 3GB Switch on my not-so-fan-of-but must-use Win 7.
what I needed to do (as they say here) is : 
run the command "BCDEdit /set increaseuserva 3072"
Restart
et voilà :D

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:
y=sqrt(x)
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:
>>x=36;
>>scriptFileName

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