No BSD License  

Highlights from
ISWHOLE

3.0

3.0 | 4 ratings Rate this file 11 Downloads (last 30 days) File Size: 966 Bytes File ID: #6277

ISWHOLE

by

 

15 Nov 2004 (Updated )

True for integers(whole numbers).

| Watch this File

File Information
Description

ISWHOLE True for integers(whole numbers).

ISWHOLE(X) is 1 for the elements of X that are integers, 0 otherwise. ISWHOLE(X1,X2,..,XN) returns a 1-by-N array with 1 for integers and 0 otherwise.

ISWHOLE does not check for integer data type as does ISINTEGER.

Acknowledgements

This file inspired Date Odometer Class.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
05 Sep 2013 Srinivas

works as expected. just make sure to delete the first line -- this file has two function declarations in it.

20 Apr 2009 Matt C

Needs some TLC and polish; though a good utility function.

20 Apr 2009 Matt C  
03 Dec 2006 Mukhtar Ullah

In continuation to previous remark: in ISWHOLE(X1,X2,..,XN), the arrays X1, X2,... can have different dimenions. How on earth can you vectorize ISWHOLE in that case?

02 Dec 2006 Mukhtar Ullah

Dear Carlos,
You seem to have completely missed what I meant. My dear, in my first syntax ISWHOLE(X), X is an array, which means it can be a vector or matrix. My second syntax ISWHOLE(X1,X2,..,XN) is for the general case when X1, X2 ,.. XN are arrays (vectors or matices). Matlab is an array oriented language, so I don't have to write that explicitely. Matlab users get it usually.

22 Nov 2006 Carlos Adrian Vargas Aguilera

What? Do you really think so, Ullah? It's Matlab! Check out like i said, Fibonacci.m or my roundd.m, is easy my friend... and then the input can be [X1,X2,..,XN] or a matrix...

20 Nov 2006 Ullah Mukhtar

Carlos,
If you only consider the first syntax I provide ,ISWHOLE(X), then you are right. I don't need varargin. The if part of the if-else structure is vectorized already. However, the non-vectorized else part, corresponds to the 2nd syntx, ISWHOLE(X1,X2,..,XN), which cannot be vectorized, at least with the current Matlab verions.

11 Nov 2006 Carlos Adrián Vargas Aguilera

Good but, why not vectorized? And why not make it for any kind of arrays? There's not need for varargin.

Check the inside of file Fibonacci.m by David Terr.

Contact us