Archimedes

"Eureka," he said. "Going to have a bath then?"

— Philosophy in action (Terry Pratchett, Small Gods)

Yay! I did something the other day I thought I could never do. See, it’s all about getting over the fear of trying and just getting your hands dirty. Even if it doesn’t work at first. It’s really silly I’d been struggling with it all day. There had been several times at which I thought, ah screw it, I’ll just go do something I can do. But for some reason I’m just too stubborn to do sloppy programming when I know that there is a neater, faster way. And I got it! Just when I was about to go home, I got it and it worked!

archimedesWhat all the fuss is about? This tiny silly piece of Matlab code:

[Exp, Fnr]= dataTOTAL(1);
%this  renders  {’
jg1′;’jg2′;’jk1’}

X = [];
H = [];
for i = 1:(length(Exp));
x = strfind(Exp(i),’jg’);
X = [X, x];
H(i) = isempty(X{i}) == 0;
end
I= findstr(1,H)

See? I told you it was silly..I did call the script ‘Eureka.m’ though *blushes*

The really embarrassing thing about it that I later found out that the script is probably very unnecessary. The struct I’m trying to get rid of here is actually easily transformed into a string by char.m, a script that comes with the software package. 

Why do I suddenly feel like I’ve run out of the house naked again?

Oh well..

This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Archimedes

  1. Flora says:

    Ohw, wat ben je toch een oehn eh!

Leave a Reply

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s