matlabideas

All things MATLAB. And Simulink.

Working with time in MATLAB

We want our programs to complete execution as fast as possible, but that’s not always the case: sometimes we want the program to execute with respect to time. This is most often the case when you use MATLAB to interact with some system that has real time behaviour (waiting for human to read a line of text before scrolling, for instance!)

In MATLAB there are generally two ways to control execution with respect to time. The first one is the pause() function.
Read more of this post

Technical Questions? This way please.

Over the years, I have been getting countless error messages in the comments section. I feel bad for not approving them, but let’s face it – not all errors can be spotted in the error messages. And the “Comments” section is meant for just that – comments.

If you have a question that you would like help with, a more effective approach is to share the offending part of the code. There it is easier for someone to point out the mistakes. I understand that some of your code may confidential and may not be suitable for posting in a public blog, so ladies and gentlemen I present to you –

MATLAB Ideas very own email account!

This way, you can ask questions privately and also attach code that creates the problem. No you have no excuse of posting error messages in the comments section. Har har. Please avoid commenting the articles unless you intend to comment or hold a discussion.

 

Having said this, if you have technical enquiries I strongly suggest that you go to the following sites:

There, you have throngs of MATLAB users that are friendly and helpful.:-)

 

Well, this is awkward…

I started this site back in Oct 2011 when I was assigned to edit articles from our engineers. We had engineers writing about all sorts of topics, and back then our newsletters are only sent to existing customers, and the number of hits per quarter is about 600. We are only reaching out to a small set of audience. Back then I thought that if we are going to put in so much effort to write and publish, why not bring it to a wider audience?

Hence, I started the MATLAB ideas blog. And I was right. Despite the postings that are few and far between, the first month alone saw 200 hits. The number of hits steadily grew to over 500 views per month. Clearly, there are people out there who are interested out there, and that motivated me to continue posting here.

However, this year we decided to discontinue our newsletters primarily due to resource limitations. So I guess… that’s all folks!

 

…or not.

 

Although I say that, I may still be posting articles in future. So stay tuned!

 

 

 

Take a break, have a pause()

Some time ago my colleague showed me an article from Undocumented MATLAB that argues in favour of the Java Thread.sleep() function instead of the MATLAB pause() function.

There are two reasons for this:

  • Thread.sleep() gives a more stable and accurate timing
  • pause() has a memory leak

“That’s unfortunate.”, I thought. But it’s nothing serious, since Thread.sleep() offers an alternative to pause(), if not a better one. It would be fun to try out Thread.sleep(), just knowing that the code I write can have better timing. This is important when I write MATLAB applications that do real-time monitoring, test and measurements.  So I set out to test how much better Thread.sleep() is. Read more of this post

The Mystery of the 120Hz Flicker

Abstract

Does Simulink play well with an Arduino board? Join me as I share my fun experience working with the Arduino board. And as a bonus: see if you are Sherlock Holmes enough to solve my mystery puzzle!

————————————————

I have an Arduino Duemilanove that I’ve purchased back in 2009. It served me nicely because every now and then, it comes in handy when I find the urge to quickly set up and experiment on some ideas. Seeing that Mathworks have been offering Simulink support for Arduino for some time, I thought this was the perfect opportunity to test out how well Simulink plays with Arduino (And this works out well, since I am supposed to do write something related to embedded systems anyway.) Read more of this post

An Engineer’s Life

Abstract

An engineer takes a step backwards to see the big picture; and figure out what an engineering life it’s all about.

————————————————

“What makes an engineer, an engineer?”

It wasn’t exactly those words, but it was more or less what I asked my uncle almost 20 years ago. My 3rd uncle worked as an engineer, and he owned a company named Techco Engineering that designed and built plant machineries. Back then, my mum shared part of my uncle’s office space; so when she brought me to the office, I found myself also wandering into my uncle’s office. Read more of this post

From MATLAB to Smartphone App

Apart from being a senior application engineer supporting Mathworks customers, I have being maintaining my past time hobby in mobile phone app development. Now, what has MATLAB got to do with mobile phone app development?

Before I joined TechSource Systems more than 1.5 year ago, MATLAB to me is just a very good mathematics modeling software, or an ‘expensive calculator’ as some people call it. I have used it during my university days to do some mathematic calculation, and during my postgraduate I have used it do symbolic maths based modeling. After joining TechSource, it dawns upon me that MATLAB is much more than an expensive calculator. With about 70 toolboxes and counting, MATLAB enables design and simulation in most scientific fields that one can think of. Read more of this post

The Journey to knowing MATLAB

Somewhere along the way during my time in college, MATLAB has been part of some of the classes. Although nothing spectacular has been accomplished on my part, I could recall class instructors being able to do some really cool things out of nowhere, with MATLAB and Simulink. My perception was: These professors must be REALLY good and experienced in programming in order to do all that. Coming from an aerospace background and having limited knowledge in programming, I used to think that MATLAB is really nothing different from languages such as C/C++, Java, FORTRAN, etc. It turned out I was wrong.

Read more of this post

Throttle down!

Posting articles about MATLAB & Simulink at a pace faster than we can write seems like a good idea… until we begin to run out of articles. I guess that’s enough warm up for now.

Will begin posting articles at a slower pace, perhaps once every two-three weeks.

Some of you may have noticed the occasional layout changes on this blog. I am trying to find the right layout so that our articles (with its code and images) can display properly.

 

And not to forget: Dear subscribers,  thank you for staying with us. I’m glad you find interesting reads, and I hope you continue to do so!

 

 

Simulink for field-programmable gate array (FPGA) automation with Xilinx – Simple & Easy

MATLAB is renowned for algorithm exploration and development. On the other hand, Simulink is capable of performing time-based multi-domain system-level design, modelling, analysis, simulation in the graphical environment. Besides, Simulink also streamlines the development of embedded systems like FPGA and provides hardware verification or co-simulation of the user design, modelling and algorithm. With hardware co-simulation and deployment, we can obtain early customer feedback and confirmation.

Therefore, Mathworks has introduced EDA Simulator Link 3.3 with the ability of FPGA co-simulation via any of several Xilinx development boards in the Simulink environment. With EDA Simulator Link 3.3, we can:

  • Develop and implement our designs on FPGAs in days or weeks rather than in months.
  • Explore implementation and design trade-offs in hardware environment.
  • Verify HDL system level design.

Read more of this post