Mar 14 2013

Optional arguments for Matlab functions

Tag: softwareadmin @ 9:53 am

The standard way to handle optional arguments in a Matlab function is to put them at the end of the call list and only include them if you want to change them. This has a lot of problems. First, what do you do if you want to change an argument that is somewhere in the middle of the list but leave the rest unchanged? Some would suggest just putting commas for the unchanged arguments but as far as I know the behavior is undefined. Does this substitute an empty variable ‘[]‘ for the other arguments? Also, this makes it hard to read the code. You have to count up the number of commas to figure out which argument is being changed.

more →

Mar 12 2013

Summary ebook available

I have prepared an ebook that compiles and organizes the posts in this blog to today’s date. You can access it by sending me email:
Energy-selective x-ray imaging and other topics.

I plan to update the book regularly and I will post an entry to the blog when an updated version is available.