Re: Function to compares two arrays and returns indices where they are equivalent



On 03/20/2011 10:56 AM, Nasser M. Abbasi wrote:
I hate the fact that in Matlab you can only have one function per file.
I think this is absurd.

It is clear then you do not know Matlab too much. ofcourse you can have
many functions inside one Matlab .m file. You can even have
inner functions inside other functions.

I'm no expert. But for that matter, neither am I an expert in Fortran. I have spent about the same time learning each. Please tell me how I can have many functions inside one .m file, I would like to use that feature.


Yes, I'm familiar with OOP in Matlab, but I
don't want to cobble my problem into the OOP framework (square peg,
round hole) just to get the very basic features that I easily get from
Fortran modules.


huh? Matlab OO is just OO. I use OO matlab now, and it very good way
to better organize your software. If you do not like or do not know OO,
that is fine. You do not have to use it. I do not understand the
square peg round hole part. Fortran modules is not OO.

I never said that Matlab OOP is different from other OOP, and I never said that Fortran modules are OOP. I don't understand how you got that impression. I am familiar with OOP, thank you. What I said is that OOP is not a good framework for my problem. OOP is not a magic bullet that makes everything better. Some problems lend themselves to be expressed in an OOP frame of reference, and some do not. My problem does not. That is what I said. I like Fortran modules because they give me some features I want (e.g. private functions and variables) without forcing me to use OOP.



If you have a syntax error, Matlab will not even allow you run the
file. It will tell you if you have synatx error and which line.

So the theory goes, but I still wasted an hour of my time, with a Matlab geek next to me, as we traced a problem with a piece of code that, in my opinion, should have been caught by the parser.


True, no one does. I don't. But life is short. if I can be
10 times more productive using a commerical tool, than a free one,
I'll take the vendor lock-in untill a free tool comes along which is
better.


I should note that "commercial vs free" is a false dichotomy. You can have a commercial tool with no lock-in (e.g. a commercial Fortran compiler) or a free tool with lock-in (e.g. one that uses a file format that no other software supports).


I don't have a general, absolute answer about whether vendor lock-in trumps other features. I almost always pick the tool that has no lock-in, but in some circumstances I can imagine myself choosing a product with lock-in. It's not likely, but it is not impossible.

Daniel.
.