1.5

1.5 | 2 ratings Rate this file 9 downloads (last 30 days) File Size: 1.57 KB File ID: #15208

ispair

by Kling & Freitag GmbH

 

05 Jun 2007 (Updated 05 Jun 2007)

Code covered by the BSD License  

find if a natural number is pair or not...

Download Now | Watch this File

File Information
Description

from all the IS* functions from MATLAB I always missed this one...

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
05 Jun 2007 John D'Errico

I had no idea what was meant by the description for this file, nor for the help. What is a "pair" number? Does this perhaps refer to prime pairs? The help refers to an "impair" number. Do you need to input a pair of numbers? Sorry, but its quite confusing. I'd call the help a bit impaired.

Once you edit the file, you find out that all this does is to test if a number is even or odd, i.e., it is testing the parity of an integer. Its pretty trivial to do, but it is functionality that is already on the file exchange.

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2006&objectType=file

Or, if you wish, just use this one line anonymous function:

iseven = @(x) mod(x,2) == 0;

06 Jun 2007 Luca Balbi

Trivial code, and misleading function name.
Should have been "iseven", badly translated from Italian/French/...

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
is Kling & Freitag GmbH 22 Oct 2008 09:14:38
pair Kling & Freitag GmbH 22 Oct 2008 09:14:38
impair Kling & Freitag GmbH 22 Oct 2008 09:14:38
general Kling & Freitag GmbH 22 Oct 2008 09:14:38
mathematics Kling & Freitag GmbH 22 Oct 2008 09:14:38
 

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