We're a little crazy, about science!

Programming overreach

This is what happens when I try to get fancy with the work I’m doing. I end up attempting to do things that aren’t done easily or if they are done easily, I figure out the hardest way possible for me to get them done. A week or so ago (here) I was excited because I came up with a super cool way to do something and I thought that the hardest part was behind me. Oh how wrong I was… but I’m close to figuring this out, I just need to do a lot of work to dig out of this hole I threw myself into. This is why you should never do anything fancy!

It’s hard to believe not that long ago I had minimal experience using MATLAB. I’ve programmed before, but every language has it’s quarks and MATLAB has no shortage of those. Syntax is always a major headache, but I’m always unpleasantly surprised with some of the limitations you run into using MATLAB. Like here’s a weird one, they don’t have built in violin plots. For software that is used a lot in research, that seems like a huge oversight. Still it does almost all the stuff we need it to do, so we use it regularly.

The thing I’m trying to do, I’m doing via a whole bunch of different toolboxes and on top of that, I’m writing a lot of the code myself. So basically the solution to this is to stitch together a bunch of different functions from various toolboxes and painstakingly write out the code to get everything I want done. I feel like I’m repeating myself at this point so let’s just get into why everything I thought would be easy is going wrong and what I plan to do about. Yep, this is a I need to have a plan so I’m writing it out to make sure it makes sense post. Hey, if I’m committing to writing about this struggle regularly I might at well get some use out of it.

The thing goes like this, I need to dynamically change some things in my plot because they change over time and this isn’t a regular old plot, no it’s a video. I did something similar for my qualifying exam and everyone loved it, so this time I’m stepping way outside my comfort zone and creating something incredibly unique that I’m really proud of, but since it’s unique there’s no ready made solution. So these features in this figure need to change, but the problem comes down to the simple fact that there are no easy ways to make this happen.

Instead, I’m left with this multifaceted issue. I need to change the location of certain things, but I also need to change the colors as well. I could probably do this using two different variables, but it would be nice to be able to use just a single variable to do all the work. In fact, what I think I will do is write a custom function that will take the relevant data and make the changes for me that I need. I just need to come up with the logic for it.

At this point I’ve glossed over the difficult part, which is how to create that function. My thought process on that goes something like this, I have a 4 dimensional vector of information that defines my solution which got squished from a five dimensional form (which was partly the thing that made me write yesterday’s post). The data are organized in a way that makes sense, but figuring out how to code that isn’t going to be easy, I could rearrange all the data into two vectors (1 dimensional lists), but then I lose the information that is contained in the location of the data. As in, the data are arranged so that their locations correspond to certain locations on my plot. So I would need a third row for that and try to use the location of the data in this long vector of numbers as some sort of index for the information stored in the fourth dimension.

Did I lose you yet? Yeah, this is why I hate working in higher dimensions and it’s also why I am not happy about this last bit of the project. I’m resolved to fix this issue TODAY! That’s the goal anyway. If I actually do it will be a whole different story. I don’t usually write custom functions to do things like this, but I think this makes the most sense because the code will probably be incredibly long (I’ve written incredibly long code before and I’m hoping this will break things up a little).

That’s basically the daily update. There are a lot of things happening externally that I won’t get answers to until Monday or so at the earliest, so if you’re looking for a more substantial event occurring vs. the somewhat mundane progress posts, Monday or Tuesday would be the time for that. In the meantime I’ll go ahead and spoil the surprise, the next few posts are probably just going to be me complaining about the outrageous amount of stuff I need to do!

Speaking of which, I should probably get some of that done…

Advertisement

But enough about us, what about you?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.