# crop

Interactive data cropping tool.

## Syntax

#### Matlab & Octave

Y = crop(X) % X is a sensor structure or [Y,tcues] = crop(X,fs) % X is a regularly sampled vector or matrix or [Y,T,tcues] = crop(X,T) % X is a regularly sampled vector or matrix

#### R

list <- crop(X) # X is a sensor list or list <- crop(X, sampling_rate) # X is a regularly sampled vector of matrix or list <- crop(X, T) # X is a regularly sampled vector or matrix

## Description

Interactive data cropping tool. This function plots the input data # and allows the user to select start and end times for cropping.

## Inputs

Input var | Description | Units |
---|---|---|

X | is a sensor structure/list, vector or matrix. X can be regularly or irregularly sampled data in any frame and unit. | N/A |

fs/sampling_rate | is the sampling rate of X in Hz. This is only needed if X is not a sensor structure and X is regularly sampled. If X is not a sensor structure/list and X is not regularly sampled, T is a vector of sampling times for X. | Hz |

## Outputs

Output var | Description | Units |
---|---|---|

Y | is a sensor structure/list, vector or matrix containing the cropped data segment. If the input is a sensor structure, the output will also be. The output has the same units, frame and sampling characteristics as the input. | N/A |

T | is a vector of sampling times for Y. This is only returned if X is irregularly sampled and X is not a sensor structure. If X is a sensor structure, the sampling times are stored in the structure. | Hz |

tcues | is a two-element vector containing the start and end time cue in seconds of the data segment kept, i.e., tcues = [start_time, end_time] (%Mat. or Oct.) tcues ← c(start_time, end_time) (#R). | seconds |

## Example

### Matlab & Octave

load_nc('testset3') Pc = crop(P); % interactively select a section of data plott(Pc) % plot shows the cropped section

### R

data <- beaked_whale Pc <- crop(data$P) #interactively select a section of data Ydata <- list(depth = Pc$Y) plott(Ydata) #plot shows the cropped section

## About

bugs@animaltags.org Last modified: 4 August 2017