Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

Loren on the Art of MATLAB has been archived and will not be updated.

Posts 21 - 30 of 66

다음에 대한 결과: Best Practice

Ensuring Positive Values – Part 1 4

Do you sometimes need to be sure an array has only bounded, positive values? At least one customer asked about this recently and noted that it could be quite involved. ... 더 읽어보기 >>

Handling Discrete Data

Discrete data arise in many applications and the data may be numeric, or non-numeric, often referred to as categorical. Not all data are strictly numeric, and other... 더 읽어보기 >>

Using parfor Loops: Getting Up and Running 81

Note. NOTE: matlabpool was removed in 2015 and you should replace that with parpool instead. Today I’d like to introduce a guest blogger, Sarah Wait... 더 읽어보기 >>

MATLAB Release 2009b – Best New Feature or ~? 53

MATLAB R2009b was recently released. My favorite new language feature is the introduction of the ~ notation to denote missing inputs in function declarations, and missing outputs in... 더 읽어보기 >>

Find Largest Positive Value Next to Zero 19

Recently, Steve wrote a blog discussing code clarity/obscurity in the context of one-line code solutions. Simply stated, the problem he solved is this. Find the largest value in an... 더 읽어보기 >>

Optional Arguments Using Empty as Placeholder 11

I recently posted about optional input arguments and how to override default values. Gautam mentioned wanting to allow empty inputs as defaults. Contents ... 더 읽어보기 >>

Nice Way to Set Function Defaults 40

Last week, I wrote a post on the switch statement in MATLAB. One theme in the comments was about using switch (or not!) for setting default values for input arguments that users didn't initialize. I realized that there is a nice pattern for setting these values that uses some compact, but readable code.... 더 읽어보기 >>

Convenient nargout Behavior 8

Here's a question that was recently posed at MathWorks. I'm trying to invoke a function handle. It either returns 0 or 1 output arguments. If it returns an output ... 더 읽어보기 >>

Nested Timing 2

Did you know that you can use tic and toc to measure times of operations that may have other timed operations nested inside? Contents ... 더 읽어보기 >>

New Ways With Random Numbers, Part II 22

Once again we're going to hear from guest blogger Peter Perkins, who is a statistical software developer here at The MathWorks. Contents ... 더 읽어보기 >>

Posts 21 - 30 of 66