interp
Contents: Description, Arguments, Usage, Examples, Images, Related Functions Supported Under Version: >1.69 Current Davinci Version: 2.27 64-bit Safe: No
Description Point interpolation algorithm which can be used to resample data to a new set of x values using either linear or cubic spline interpolation. NOTE: The X value must be monotonically increasing. Or more simply, the next number must be larger than the previous number.
Arguments and Return Values Arguments: An X and Y numerical array pair and a new X numerical array. Return Value: A numerical array of Y values which is resampled to the new X numerical array
Usage Syntax: interp(object = VAL, from = VAL, to = VAL [,type = STRING] [,ignore = VAL] ) object - a set of Y values that correspond to the original or from X values from - a set of X values that correspond to the object Y values to - the new set of X values which will be the resampling source data type - the type of interpolation ("linear" (default) and "cubic" are the only two options) ignore - ignore value
Examples dv> original struct, 2 elements data: 1x1x1000 array of float, bsq format [4,000 bytes] xaxis: 1x1x1000 array of float, bsq format [4,000 bytes] dv> new_xaxis 1x1x50 array of float, bsq format [200 bytes] dv> interpolated_data = interp(original.data, original.xaxis, new_xaxis) 1x1x50 array of float, bsq format [200 bytes] dv> interpolated_data = interp(original.data, original.xaxis, new_xaxis, type = "cubic") 1x1x50 array of float, bsq format [200 bytes]
dv> interp(4//8//12//16//20//24,2.//4.//7.//9.//12.//16.,3.) 6.000000000 dv> interp(4//8//12//16//20//24,-2.//-4.//-7.//-9.//-12.//-16.,-3.) 11.00000000 The second answer should also be 6. This function also only works on single data points; trying to use it to interpolate 2d arrays of data will fail.
|
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Recent Core Changes Modified On: 07-23-2012 |