Rank: 1337 based on 82 downloads (last 30 days) and 3 files submitted
photo

Peter Mao

E-mail
Company/University
Caltech
Lat/Long
34.13808, -118.13008

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Peter View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Jun 2009 subarray Extracts a subarray from an array. Useful for function outputs. Author: Peter Mao matrix, submatrix, array manipulation, array, subset, subarray 17 1
20 Jun 2006 Screenshot textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao placement, location, customization, best, potw, text 57 3
  • 5.0
5.0 | 3 ratings
09 Jun 2006 Compact data uncertainty format given data and uncertainty, this program reformats the number into parenthetic notation. Author: Peter Mao parentheses, parenthetical, uncertainty, confidence interval, strings, format 8 2
  • 5.0
5.0 | 1 rating
Comments and Ratings on Peter's Files View all
Updated File Comment by Comments Rating
17 Jun 2009 subarray Extracts a subarray from an array. Useful for function outputs. Author: Peter Mao Fig, Matt

You could also do this:

a = foo(x,y,z);
a = a(2,9:end);

Then there is no temporary variable polluting your workspace.

05 Jan 2009 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Foster, Scott

This is a great bit of code for what it does. Very easy to use, and exactly what I was looking for.

30 Nov 2007 Compact data uncertainty format given data and uncertainty, this program reformats the number into parenthetic notation. Author: Peter Mao mao, peter

After seeing Rolf's comment, I thought about adding in special handling for sigma==0, but then decided against it.

Consider if the uncertainty was infinitesimally small. Then one would have an enormous number of significant digits. With ZERO uncertainty, then one must report an infinite number of significant digits!

I suggest that Rolf put an if-then around this code to get the result he desires. I don't think it is appropriate to handle that within this code.

Thanks for your comment.

Peter

15 Nov 2007 Compact data uncertainty format given data and uncertainty, this program reformats the number into parenthetic notation. Author: Peter Mao Heidemann, Rolf

Very useful.
The input uncertainty of 0 should be treated, e.g as omitting the parentheses.

17 Oct 2006 textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao Solimeno, Bob

Beautiful! This code does exactly what I want to achieve. A very nice, simple substiture for the MATLAB text command where hands-off annotation is desired!

Top Tags Applied by Peter
annotation, array, array manipulation, automatic, best
Files Tagged by Peter View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Jun 2009 subarray Extracts a subarray from an array. Useful for function outputs. Author: Peter Mao matrix, submatrix, array manipulation, array, subset, subarray 17 1
20 Jun 2006 Screenshot textbp: text with legend-style "best" placement automatically locates text annotation to minimize figure obscuration Author: Peter Mao placement, location, customization, best, potw, text 57 3
  • 5.0
5.0 | 3 ratings
09 Jun 2006 Compact data uncertainty format given data and uncertainty, this program reformats the number into parenthetic notation. Author: Peter Mao parentheses, parenthetical, uncertainty, confidence interval, strings, format 8 2
  • 5.0
5.0 | 1 rating
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com