Quick and dirty compatibility enhancements

14 views
Skip to first unread message

Philip

unread,
May 14, 2011, 11:30:34 PM5/14/11
to freema...@googlegroups.com
Hi,

The function "figure" is one of many FreeMat built-ins that has a namesake with slightly different expectations in Matlab. Many of my Matlab scripts open plotting windows using lines like
figure('Name','Density Plot');
This breaks in FreeMat, where figure takes a single numeric argument. But in truth I barely care about my figure's name, so I would be quite content if FreeMat's figure would simply ignore my unfamiliar input arguments and pretend I had said just 'figure;'. This would take a little work to arrange, but not much: one would just change the function header in figure to receive input arguments through varargin, handle the first input argument if it happens to be a number, and ignore all input arguments if it is not.

There are other opportunities for this kind of improvement. Whenever a user supplies a handle-graphics property that FreeMat does not recognize (maybe because it's a Matlab-only thing, or maybe because it's an error), I would suggest either silently ignoring it or printing a warning and trying to proceed anyway. This way of thinking could make a lot more native Matlab scripts run to completion with warnings instead of stopping early with errors under FreeMat. It would be interesting to hear whether the community thinks this idea is worth pursuing.

Respectfully, Philip

J Luis

unread,
May 15, 2011, 1:11:02 PM5/15/11
to freemat-devel
Philip,

I fully agree with you. I have a quite large package that relies
heavily on ML handles graphics and that I would love to port to
Freemat.
However, the issues you mention raised the first barrier on this task.

Best regards

Joaquim Luis
Reply all
Reply to author
Forward
0 new messages