datashift
by Ali Mohammad Razeghi
19 May 2008
(Updated 20 May 2008)
Finds the maximum difference between numbers of a set then shifts the numbers up and down.
|
Watch this File
|
| File Information |
| Description |
Finds the difference between two near elements in a set of numbers then finds the maximum of the differences then separates the set into two parts and shift them close to each other. The "a" parameter says to code how much must the lower subset shifts up and the higher subset shifts down.
Clarification: The reason of writing this code is a laboratory
experiment. In the experiment we have a change of two lamps. This change
constructs a gap in the set of experiments data that we know that it must be not realy exist for a substance of experiment and the lamp changing cause that not the substance. This program finds the gap in the set of numbers then shifts two subsets close to each other.
Example: A = [ -3 -1 1 2 3 7 8 10 11 13 15 ] ; B = datashift ( A , 1 )
B = -2 0 2 3 4 4 5 7 8 10 12 |
| MATLAB release |
MATLAB 7.2 (R2006a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (1) |
| 20 May 2008 |
John D'Errico
|
|
|
|
Contact us at files@mathworks.com