Saturday, 7 November 2009

An Unusually Productive Day


Saturdays are always fairly boring and I usually end up trying to work and failing miserably. Today however, there must have been something in the air that sparked me on and encouraged me to put pen to paper (or fingers to keys) and start looking a bit deeper into the MatLab GUI capabilities. I spent the first couple of hours getting rather frustrated at the differences between the MatLab syntax in comparison to that of Java, a language I am much more familiar with. I suppose it is a slight disadvantage not having learned C++ on which MatLab is based but that's not my fault because the university decided that Java was a better starting point. Whether they have got this right or not I am yet to find out but thus far, it has served me well when picking up other languages although for the majority of them I have had formal instruction. It was only PHP and HTML that I have so far self taught and that is widely helped by the availability of free resources on the internet. PHP and HTML being the backbone of a vast number of websites on the internet and PHP being open source means that there are hundreds of thousands of books and tutorials available and one of them is bound to fit your programming style. MatLab on the other hand, whilst widely used in education is very expensive and although the Mathworks website does have documentation, often the examples can be quite difficult to comprehend and go into far more detail than you would ever need.

One of the main reasons for this I suppose is that I'm not exactly using it for what it was designed for. I'm not manipulating matrices and I'm not plotting complicated graphs. I don't even really understand the maths behind the structures that I'm using and that seems to be a fundamental flaw in my knowledge. I never really got to grips with matrices in maths and didn't even study them in school. Not taking further maths seems to be a big mistake because about 90% of students on my course seem to have done and at least had a very basic understanding of how they worked. I was starting from scratch and managed to avoid the questions relating to them in the exams. Thankfully the exams were structured so that you only had to answer three out of four questions and matrices were always in a question of their own. Knowing my luck they will turn out to be really important in later life (unlike anything else you seem to learn in maths) and not understanding them will result in a life of squalor.

Eventually however, I did manage to get somewhere. I battled with variables whose scope seemed to exist only in their designated function until I discovered the persistent variables; I couldn't work out how to use get and set methods for these variables because I could only use them in one function. It all seemed a bit backwards and lacking in functionality compared with what I'm used to. I can't work out how to use multidimensional arrays because they are based around matrices (which I don't understand!). I managed to get a working interface despite these problems and it even worked exactly how I planned it to. Of course, not content with that I decided I had to go and make it more complicated and when I left it this evening to collapse in exhaustion, there were a plethora of syntax errors and various other error messages reported. It's actually quite difficult to debug the functions individually so I printed the code out to scour through tomorrow and track down the problems.

No comments:

Post a Comment