Archive for the ‘Matlab’ Category

SimMechanics in Matlab for Linux (Ubuntu 9.10) :: problem

April 24, 2010 Leave a comment

I’m running on Ubuntu 9.10 and my Maltlab versions are 2008b and 2009b.  Following commands are fixing OpenGL issue/problem ( )

cd /usr/lib
sudo ln -s
sudo ln -s

Categories: Matlab, Ubuntu Geek

Matlab: import data to workspace from files via variables

January 3, 2010 Leave a comment

Situation is following. You have several data files and you need to import them to your workspace in cycle. Bear in mind function eval()

Solution is :

clc; clear all;


case1= [NAME1 STAT1 ENDING];
case2= [NAME2 STAT1 ENDING];
case3= [NAME3 STAT1 ENDING];

for  i=[1:1:3]
load([FOLDER eval([‘case’ int2str(i)])])

Categories: Matlab

PJUG – the first contact [part 3] – Matlab Chart (WebFigure) on Tomcat 6.x server

December 18, 2009 4 comments

This part covers the last example I did on JavaCamp. Over 3 videos you have an opportunity to see how to setup your environment, how to develop and compile your .M file to Java Jar file using Matlab JA Builder and how to write simple JSP/Servlet and deploy everything together on Tomcat 6.x

Before you start watching. It’s good to mention an issue with sound. I have recorded these sequences by using recordMyDesktop software. It’s very nice but 😉 I got issue with sound record. Actually you will see.


1. Build JAR file from Matlab M. files

2.  JSP/Servlet using Matlab JAR file

3. Matlab WebFigure and Tomcat 6.x deployment

Categories: JAVA, Matlab

PJUG – the first contact [part 2] Ubuntu env. setup for Matlab JavaEE

December 9, 2009 2 comments

I’m back again as I have promised in my last post. Today i’m gonna show how to setup your Ubuntu 9.04 operating system and Tomcat 6.x for your Matlab JavaEE application development. I hope you are ready. Let’s start with … !

During my googling time I didn’t search any blogpost focused on that topic even from Windows. That was little bit surprise to me.  I found only several nice examples which were only on image. No describtion how deploy them.  So my enviroin ment setup became to be more chanlenging to me.

What you need to follow me.  My system is Ubuntu 9.04, JDK 1.6.0_16, Tomcat 6.x, IntelliJ IDEA 8.1.3,  Matlab 2009b and MATLAB Builder JA 2.0.4 for Java language.

I expected you have installed you IDE correctly so I’m skipping this and I start:

  • Install JDK 1.6 or higher as it’s recommended
  • Install Matlab 2009b to your $MATLABROOT folder
  • Setup properly you environment properties. They have to be linked with your Matlab because you will need them for your application compilation.  You may set up them to your .bashrc using for example gedit. It’s up to you.  You have to setup these variables $LD_LIBRARY_PATH and $XAPPLRESDIR.  Here is a help what to specify:

export LD_LIBRARY_PATH=$matlabroot/runtime/glnx86:$matlabroot/bin/glnx86:$matlabroot/sys/os/glnx86/:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/native_threads:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/server:$matlabroot/sys/java/jre/glnx86/jre/lib/i386/:${LD_LIBRARY_PATH}
export XAPPLRESDIR=$matlabroot/X11/app-defaults

# XAPPLRESDIR access to Matlab graphical functions as plot, figure

  • Next task is to install Tomcat 6.x. I have used it from Ubuntu repository.  Then you should link it with your IDE but I guess it’s simple task for you as you are familiar with.
  • Very important point connected with Tomcat 6.x usage for Matlab JavaEE applications deployment is to do change in <TOMCAT FOLDER>/conf/context.xml. Just after tag <Context> place following tag with properties <Loader delegate=”true”/>

This is problem caused by org.apache.AnnotationProcessor due to efforts from MYFACES-1246. The statement makes classloading in Tomcat sticking to JavaEE specification. This bug was really stupid.

Now is your system ready to start with JavaSE and JavaEE App development. I will gonna show in next text. Stay tuned I hope you are still involved.

Categories: JAVA, Matlab, Ubuntu Geek

PJUG – the first contact [part 1]

December 8, 2009 1 comment

I was so impressed I'm eating very spicy pizza with Chilli. It was great

I haven’t  written my blog for while because I was analyzing data from Neurology Checkups during this time. I was very busy due to finish several tasks. Now is situation little bit better but still I’m under rush as common.

One night when I was writing Servlet/JSP pages for other project  guys from Polish JavaUserGroup asked me to come to give presentation called “Matlab with Java injection”.  I know this title is very interesting as a way of Java usage together with Matlab. I love the fact that part of Matlab is written in Java, but there is no nice connection. I understand to reason why ….

It was my second visit of Krakow. It’s funny because together with guys from Krakow we have organized GeeCON conference. This is an example of Internet power. I love skype, email and chatting. Back to the PJUG.

I gave  my first presentation here for PJUG. It was great. I was surprised and impressed since the first moment about quality of everything. Atmosphere was so nice and guys looks like they are really interesting and they are educated around. I have to give big compliment in general!

My presentation topic was as you know “Matlab with Java injection”. It was very challenging since the start of using Matlab in that way.  You can imagine little less documentation for windows users and similar to Linux. But Linux was worse since my point of view. So that was very challenging to me start work at this in the past. I wrote in the past assimilations for University purposes using Java. That was very different. I  found out also  one bug after long googling and thinking time connected with Tomcat 6 Annotation check as you will see on the part 2 ….

After I gave this presso it seems like everybody loves such way of JAVA usage. I was really happy I got so many questions . Stay tuned and have a nice day

Categories: JAVA, Matlab

How to genereate random integer numbers ?

August 28, 2009 2 comments

Last night I need to solve this question. This stuff is very easy to do under JAVA based languages but not so easy under Matlab. I thought for while and then I realized that this is very simple. To generate random number under Matlab you are commonly using function rand(NUMBER). Rand generate array that’s the case. I thought for while and here is the simple solution.

%define size of Ineger number you need
size = 100
iNum = round(rand(1)*100);
% You get number example. iNum = 23
Categories: Matlab

Matlab wisdom is around us …

August 28, 2009 Leave a comment


This category gonna be focused on around information which are sometimes useful when you are working with MatLab.  My PhD is for me like big stimul. It still focing me to learn new things. Someone is reading any popular magazines focused on current trends in style. My hobby is to learning new technical/financial things … my brains is to hungry to stop with.  So this category is about Matlab 🙂

Categories: Matlab