Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'MatLab X11 plots are interactive' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
MatLab X11 plots are interactive
Authored by: ennisdb on Apr 04, '05 03:18:52PM

I agree this is only relatively useful, but it points towards the ability to better interface Matlab and OS X. These things can be wrapped into an m-file to increase the usability. I previously wrote the following function to help me compare two m-files. I thought others might find it useful.


% This function sends an external call to FileMerge to compare two files a lá
% xdiff. If which(fname#) is empty (eg Matlab can't find it), then the fname#
% is assumed to be a full pathname (relative or absolute).
%
% SYNTAX: xdiff(fname1,fname2) OR xdiff fname1 fname2
%
% Place the following script in ~/bin and make it executable.
%
% #!/bin/sh
% /Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge -left $1 -right $2
%
% DBE 02/21/04
function xdiff(fname1,fname2);
tmp1=which(fname1);
if ~isempty(tmp1), fname1=tmp1; end % Assume the fname is a complete absolute or relative path if WHICH can't find it
tmp2=which(fname2);
if ~isempty(tmp2), fname2=tmp2; end % Assume the fname is a complete absolute or relative path if WHICH can't find it

cmmnd=['~/bin/xdiff ',fname1,' ',fname2,' &'];
unix(cmmnd);
return



[ Reply to This | # ]
MatLab X11 plots are interactive
Authored by: gustou on Apr 05, '05 08:04:23AM

What about a :
FileMergeApp = '/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge'

cmmd = sprintf('%s -left %s -right %s &', FileMergeApp, fname1, fname2);
unix(cmmnd);

This solution is a purely Matlab solution no ?



[ Reply to This | # ]