***at least in my version of MATLAB. Has this changed?*

This small set of .c files almost submerged to public oblivion since for a long time, it had the smallest number of downloads compared to my other submissions. It is very encouraging to realize that somewhere out there, there is an open eye for humble, painfully coded, original code contributions. Judging from the download numbers to date, I can safely infer that the vast majority of MatLabCentral/FileExchange visitors are simply not interested about C-MEX programming. And the reason is simple: It’s the very same reason they went to MatLab usage in the first place! To avoid the complexities and pains of lower level languages like C/C++. In my point of view, any skilled engineer should be able to write code in lower level languages as well. The extra degrees of freedom provided by the C-MEX programming paradigm cannot be overemphasized. C-MEX programming provides the ability to bridge the gap of MatLab and C/C++ enabling the benefits of both worlds. The apt programmer keeps MatLab’s unmatched functionality while for computationally expensive code blocks he lowers his mouth and speaks (almost) directly to the ears of the processor in a language that is more intelligible to it. The results are simply impressive! ]]>

v = cell2mat(arrayfun(@colon,startidx,stride,endidx,'uni',0)).'; disp(v) 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 4.0000 3.0000 2.0000 1.0000 0 3.1416 6.2832 9.4248

(of course this is not optimized for speed as mcolon is)

]]>I saw that the value in the app did show greater than one mach 1. I guess I could have added a nonlinear constraint to insure this but that would’ve required many more function evaluations. I didn’t look into the Wing Designer code enough to see if properly punished breaking the sound barrier.

It did have a few additional checks inside of the app for parameters such as payload (what allows you to have a negative score) so I am guessing that adding a few more could keep the optimizer in check without even needing nonlinear constraints.

% Sean

]]>

We just finished up a student design project for a long-endurance UAV, so I had a good chuckle when I saw this pick show up a few days after submission. We ended up with a decent little sizing algorithm, but since no one knew much of anything about optimization, we resorted to the brute force method of computing the entire design domain. (We were looking for minimum airframe cost for a given cruise speed, endurance, and wingspan, so it wasn’t prohibitive.) With another couple of weeks, we probably could have plugged the routine into one of the optimization functions, but there just wasn’t quite enough time in the semester for that extra bit of fun.

]]>http://www.mathworks.com/matlabcentral/fileexchange/46483-2048-game-solver ]]>