What non-built-in functions do you use frequently?
조회 수: 3(최근 30일)
A handful of homemade functions in my filepath get used at least weekly. Not all of them are beautifully written or impressive in any way, but they simply solve little recurring problems. Of the scripts like this that I've written for myself I've often thought, "why didn't I write this years ago?"
Do you frequently use any non-specialized functions that solve problems big or small?
Image Analyst 2014년 12월 15일
I use John D'Errico's allwords() and polyfitn() quite a bit. I also use Yair Altman's MaximizeFigureWindow code (attached and updated for R2014b and earlier). And of course export_fig() like almost everyone else.
I use xlswrite1 by By Matt Swartz to write to Excel, along with a class I wrote that does a ton of various Excel operations via ActiveX, like formatting borders, numbers, sizes/widths, etc.
I use little utilities I wrote to warn/alert/notify the user modally, get number of bits, get a folder for custom settings for my app (because Windows doesn't allow anything under the Program Files folder where my apps get installed), and get the executable folder of a compiled application (all attached). I also use my function to extract the N largest (or smallest) blobs from a binary image quite a bit because there's nothing built in to the Image Processing Toolbox to do that conveniently.
I also maintain an m-file that's nothing but random, assorted, commonly used snippets, called common_code.m. I often pull snippets from there when I build the demos I upload here.
Sean de Wolski 2014년 12월 15일
편집: Sean de Wolski 2014년 12월 15일
The one I've been using a ton recently:
% Make directory and navigate to it
% See Also: mkdir, cd
% One input expected, must be row string
DGM 2022년 8월 3일
편집: DGM 2022년 8월 3일
I know nobody needs a thread revival, but it's something that I'm constantly reminded of because I have to avoid it in posting things on the forum. I use MIMT imrange() all the time for fetching the global extrema of arrays. It's such a ridiculously simple and obvious convenience that losing it drives me bananas.
A = imread('cameraman.tif');
rg = imrange(A)
[mn mx] = imrange(A)
There are tons of things in MIMT that I think would qualify, but imrange() is the most simple, general, and frequent.