Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Movingslope 1.0

Date Added: August 30, 2013  |  Visits: 238

The gradient function in Matlab allows you to compute the slope of a curve along its entire length. But if your curve is a noisy one, then gradient will also be noisy. In this event one might desire to fit a moderately low order polynomial regression model in a sliding window, then differentiate that model. (Like a Savitzky-Golay filter.) All of this can be done efficiently in Matlab using filter. Note that this tool does not constrain the length of the support to be even or odd.Also, this tool uses pinv to generate the filter coefficients - a more stable and accurate methodology than does the sgolay tool on the file exchange.A few examples of movingslope in action:Estimate the first derivative using a 7 point window with first through fourth order models in the sliding window. Note that the higher order approximations provide better accuracy on this curve with no noise. t = 0:.1:1;vec = exp(t);Dvec = movingslope(vec,7,1,.1)Dvec =Columns 1 through 7 1.3657 1.3657 1.3657 1.3657 1.5093 1.668 1.8435Columns 8 through 11 2.0373 2.0373 2.0373 2.0373Dvec = movingslope(vec,7,2,.1)Dvec =Columns 1 through 7 0.95747 1.0935 1.2296 1.3657 1.5093 1.668 1.8435Columns 8 through 11 2.0373 2.2403 2.4433 2.6463Dvec = movingslope(vec,7,3,.1)Dvec =Columns 1 through 7 1.0027 1.1049 1.2206 1.3498 1.4918 1.6487 1.8221Columns 8 through 11 2.0137 2.2268 2.4602 2.7138Dvec = movingslope(vec,7,4,.1)Dvec = Columns 1 through 7 0.99988 1.1052 1.2214 1.3498 1.4918 1.6487 1.8221Columns 8 through 11 2.0137 2.2255 2.4597 2.7181Estimate the slope of a noisy curve, using a locally quadratic approximation. In this case, use a straight line so that we know the true slope should be 1. Use a moderately wide window (10 points), since we have noisy data.t = 0:100;vec = t + randn(size(t));Dvec = movingslope(vec,10,2,1)mean(Dvec)ans = 1.0013std(Dvec)ans = 0.10598By way of comparison, gradient gives a much noisier estimate of the slope of this curve.std(gradient(vec))ans = 0.69847As a time test, generate a random data vector of length 500000. Compute the slopes using a window of width 10 and a quadratic approximation in the sliding window.vec = rand(1,500000);ticDvec = movingslope(vec,10,2);tocElapsed time is 0.626021 seconds.

 Requirements: No special requirements Platforms: Matlab Keyword: Columns,  Dvec,  Estimate,  Locally,  Movingslopevec Dvec Users rating: 0/10

 License: Freeware Size: 10 KB
USER REVIEWS
 More Reviews or Write Review
MOVINGSLOPE RELATED
 Libraries  -  Tk::Columns 0.03 Tk::Columns is a multicolumn list widget with sortable & sizeable columns. SYNOPSIS use Tk::Columns; \$Columns = \$parent->B ( -columnlabels => [qw (column1 column2)] -listbackground => white, -listforeground => black, -buttonforeground... 51.2 KB Text Management  -  Formatting plain text into columns 1.0 This script formats a number of columns of text into fixed widths. Each column may also be aligned independently. Whitespace is collapsed, though line breaks are retained (they may optionally be ignored). Modules  -  Product Listing in Columns 2.2 Instead of a single column list it allows you to have multiple columns.Format is similar to the whats new module. Feedback on extra features welcome.Only downside is that due to changes in 2.2 you need a very recent snapshot for this to work. Form Processors  -  Insert/Delete Table Rows/Columns 1.0 Insert/Delete Table Rows/Columns script allows users to insert rows left or right of the selected cell, insert columns left or right of a selected cell, or delete selected rows or columns in a table.Script will work for multiple tables and tables... 10 KB Communication  -  Circular Cross Correlation of the Columns of an Array - circ xcorr 1.0 The program takes the columns of an input matrix and calculates the auto and cross correlation of these columns using an fft method. The result is very similar to the xcorr function. This method could be used to evaluate the cross correlation of... 10 KB Communication  -  plotColumns.m: plots columns in matrix as time series 1.0 [h,varargout]=plotColumns(data,varargin)plots columns of a matrix as if each column is a time seriesUSAGE:plotColumns(data);[h] = plotColumns(t,data);[h] = plotColumns(t,data,{colors});[h] = plotColumns(t,data,'plotopt');[h] =... 10 KB Development Tools  -  GUI for distillation columns: McCabe and Thiele Method. 1.0 This GUI uses a constant relative volatility (alpha) to estimate the equilibrium curve. From there, the GUI uses the "McCabe and Thiele Graphical Method" to estimate the ideal number of plates in the column.A reference is provided in the GUI: look... 10 KB Development Tools  -  MCC to estimate the Superficial Ocean Currents on SST images 1.0 This script applies the Maximum Correlation Cross on SST images, to estimate the superficial ocean currents 10 KB Networking  -  WP Columns 1.0 There are similar plugins but they did not provide the ease of use I wanted.Creating columns is super easy, just include the column separator text in your page or post (by default /---/, configurable in the WP Column Settings page).HTML code will... 10 KB Networking  -  Magazine Columns 1.0.3 This plugin creates magazine style columns in your posts and pages.Installation : 1. Unzip the magazine-columns.zip file. 2. Upload the magazine-columns folder to the /wp-content/plugins/ directory. 3. Activate the plugin through the 'Plugins'... 10 KB