Matlab Central

Don't use both the [matlab] and [octave] tags, unless the question is explicitly about the similarities or differences between the two. be/piJJ9t7qUUo For code see [email protected] com:Montalvo/. We now discuss the transfer between multiple subscripts and linear indexing. Select a Web Site. Welcome to the new Software @ Berkeley site! The Software website has a fresh new look and improved organization to help you quickly identify and access campus licensed software. Dynamic Response of SDOF - Matlab Code - Free download as PDF File (. Take Home Exercise 1: Central Limit Theorem in Matlab. Based on your location, we recommend that you select:. We will be using the same data from previous posts. Some programmers prefer to use underscore to separate parts. MATLAB is a programming language developed by MathWorks. net is a resource for the technical computing and engineering community. This page covers basic OFDM transmitter chain viz. Central Difference. Find detailed answers to questions about coding, structures, functions, applications and libraries. The best place to learn about MATLAB and Simulink from the experts at MathWorks | MATLAB Central Blogs. With the growth of Data science in recent years, we have seen a growth in the development of the tools for it. Introduction. View questions and answers from the MATLAB Central community. However, several UCLA departments do offer Matlab to their associated affiliated Faculty, Staff or Students. txt) or read online for free. Description: kmeans algorithm is an iterative solution clustering analysis algorithm. This work presents a method of solution of fundamental governing equations of computational fluid dynamics (CFD) using Semi-Implicit Method for Pressure-Linked Equations (SIMPLE) in MATLAB ®. Andrew Patton's Matlab code page. Kay Fitts Dept. These products are restricted to use in the support of classroom instruction and research activities of students, faculty, and staff. Based on your location, we recommend that you select:. FD1D_ADVECTION_FTCS is a MATLAB program which applies the finite difference method to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the FTCS method, forward time difference, centered space difference. CME 102 Matlab Workbook 2008-2009 5/55 1. The central difference for a function tabulated at equal intervals is defined by. Ask and Answer MATLAB Answers. Blackjack Strategy Tester. DFIELD and PPLANE The programs dfield and pplane are described in some detail in the manual Ordinary Differential Equations using MATLAB. Choose a web site to get translated content where available and see local events and offers. This is a MATLAB program that takes in a csv file depicting a Blackjack playing strategy and outputs the house edge of that strategy and a graph of bankroll trend while playing using that strategy. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Find detailed answers to questions about coding, structures, functions, applications and libraries. Find the best answers about MATLAB, Simulink, and related products. Matrix generation is the most important factor on matlab because which is the basic elements of matlab environment. In statistics, a central composite design is an experimental design, useful in response surface methodology, for building a second order (quadratic) model for the response variable without needing to use a complete three-level factorial experiment. Section 2: Finite Difference Techniques and Applications (Matlab Examples). Select a Web Site. Hi I have a number of points (experimental data) plotted as an x-y plot. If you'd like to use RK4 in conjunction with the Finite Difference Method watch this video https://youtu. ###Functionality. PROBLEM STATEMENT. MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming 🖥️ Follow us on Instagram @MATLAB. include() However I'm surprised to find out that I can't seem to find any official documentation about it. Ask and find the best answers about MATLAB and Simulink. 1 Basic Concepts in Matlab Michael G. ", and more details can be found in paper. Accelerating the pace of engineering and science. EXE to unite the. In its simplest form, you pass the function you want to differentiate to diff command as an argument. Select a Web Site. Kay Fitts Dept. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Based on your location, we recommend that you select:. Davide Scaramuzza is Professor of Robotics at the University of Zurich. matlab code. Choose a web site to get translated content where available and see local events and offers. These products are restricted to use in the support of classroom instruction and research activities of students, faculty, and staff. An example to allow Matlab stand-alone developers to incorporate direct access to a relational database as part of their work. Hi I'm trying to find out how to create a module in Matlab, that can be called using module. how to create timeline plot?. PROBLEM STATEMENT. This is the code for the paper " PCA based Edge-preserving Features for Hyperspectral Image Classification, IEEE Transactions on Geoscience and Remote Sensing, 2017, 55(12), 7140-7151. MatlabBGL is a Matlab package for working with graphs. Welcome to the new Software @ Berkeley site! The Software website has a fresh new look and improved organization to help you quickly identify and access campus licensed software. Flow Control MATLAB supports the basic flow control constructs found in most high level programming languages. 2 Finding Numerical Solutions MATLAB has a number of tools for numerically solving ordinary differential equations. Could any one help me to do it for this small data so I can I apply to my data X 0. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Interests(Arduino, Rasp'pi, quad/bipedal control). FlowBox, sui. Based on your location, we recommend that you select:. Cody is a MATLAB problem-solving game that challenges you to expand your knowledge. Select a Web Site. of Industrial and Systems Engineering North Carolina State University Raleigh, NC 27695-7906, USA. This is the code for the paper " PCA based Edge-preserving Features for Hyperspectral Image Classification, IEEE Transactions on Geoscience and Remote Sensing, 2017, 55(12), 7140-7151. MATLAB Style Guidelines 8 specific, such as E for Young's modulus, which would be misleading as e. Work with your files from anywhere, share with others. Take Home Exercise 1: Central Limit Theorem in Matlab. · Forward Difference · Backward Difference · Central Difference. MATLAB Style Guidelines 8 specific, such as E for Young’s modulus, which would be misleading as e. If you want to calculate the first derivative of a single variable function, then the simplest way is to use the Matlab gradient function. MATLAB Central - File Exchange Pick of the Week » Finding the Best Distribution That Fits the Data - Free download as PDF File (. It combines high-level language with a desktop environment suitable for iterative engineering and scientific workflows. OFDM MATLAB Code. It would certainly be a weird, unhelpful question if the prospect has no interest in other languages and can get the same results in their language(s) of choice. Book web site for Digital Image Processing by Gonzalez & Woods and for Digital Image Processing Using MATLAB by Gonzalez, Woods, & Eddins. Take Home Exercise 1: Central Limit Theorem in Matlab. It started out as a matrix programming language where linear algebra programming was simple. Existing gas or electric water heaters can become inefficient through the overheating of water and through parasitic heat loss. OFDM MATLAB Code. Get support from 100,000 community members and MathWorks employees, and solutions from a pool of over 110,000 answered questions. matlab programmer/programming source code download. computing finite difference weights. Select a Web Site. This tutorial gives you aggressively a gentle introduction of MATLAB programming. 在R2019a 中,Simulink Onramp 在哪里打开?请详细告诉我!. how to create timeline plot?. Contents: Introduction; MATLAB Versions; Matrices as Fundamental Objects; Matrix Operations; Assignment Statements; Case Sensitivity; Immediate and Deferred Execution. Find detailed answers to questions about coding, structures, functions, applications and libraries. Based on your location, we recommend that you select:. Choose a web site to get translated content where available and see local events and offers. R and Python have been steady languages used by people worldwide. This post is the result of an online conversation about tidal ellipses and how to compute them in Python. Learn more about simulink onramp,, simulink,, matlab r2019a Simulink. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Worsley's FMRISTAT or Gang Chen's 5-way ANOVA or user cuddly 3dDeconvolve. 1 Basic Concepts in Matlab Michael G. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Discover Live Editor. pdf), Text File (. It contains MATLAB implementations of various classical time-scale modification (TSM) algorithms like OLA, WSOLA, and the phase vocoder. What is EEGLAB? EEGLAB is an interactive Matlab toolbox for processing continuous and event-related EEG, MEG and other electrophysiological data incorporating independent component analysis (ICA), time/frequency analysis, artifact rejection, event-related statistics, and several useful modes of visualization of the averaged and single-trial data. Could any one help me to do it for this small data so I can I apply to my data X 0. EXE to unite the. Trendy is a MATLAB Central application that scrapes a time series dataset from website(s) you specify. Some programmers prefer to use underscore to separate parts. Students, faculty and staff on all three U of I campuses - Urbana-Champaign, Chicago, and Springfield - are eligible to receive significant discounts on over 350 software applications and software training courses offered by the U of I WebStore. Filled Area Plots in MATLAB How to make a filled area plot in MATLAB. Trendy uses this data to maintain a plot for you, which it updates automatically with each new data point captured. Based on your location, we recommend that you select:. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. His main research interest is low-latency computer vision applied to the autonomous navigation of visually-guided ground and flying robots. Find the best answers about MATLAB, Simulink, and related products. This tutorial gives you aggressively a gentle introduction of MATLAB programming. Sharpen your programming skills while having fun!. It contains MATLAB implementations of various classical time-scale modification (TSM) algorithms like OLA, WSOLA, and the phase vocoder. Central Limit Theorem - Rolling N Dice Matlab code - for illustration of CLT by flipping N Coins : File_3: central_limit_theorem_coins. k-means is a decent clustering algorithm, however it requires the specification of the number of clusters, and is stochastic. of Industrial and Systems Engineering North Carolina State University Raleigh, NC 27695-7906, USA. dspGuru provides a wide variety of DSP information to help you master the complex domain of Digital Signal Processing, including: FAQs: At last, Frequently Asked Questions about DSP meet up with Rarely Given Answers, in a friendly, tutorial format. The central difference for a function tabulated at equal intervals is defined by. Flow Control MATLAB supports the basic flow control constructs found in most high level programming languages. PROBLEM STATEMENT. Select a Web Site. Section 2: Finite Difference Techniques and Applications (Matlab Examples). This may be useful for those who want to carry out matlab-based computations such as Dr. I want to generate the derivative of y w. TSM toolbox. Worsley's FMRISTAT or Gang Chen's 5-way ANOVA or user cuddly 3dDeconvolve. This page covers basic OFDM transmitter chain viz. alpert_rule, a library which can set up an Alpert quadrature rule for functions which are regular, log(x) singular, or 1/sqrt(x) singular. Trendy is a MATLAB Central application that scrapes a time series dataset from website(s) you specify. It contains MATLAB implementations of various classical time-scale modification (TSM) algorithms like OLA, WSOLA, and the phase vocoder. Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:. The goal of this demo is to showcase integration of C code in MATLAB and Simulink. Interests(Arduino, Rasp'pi, quad/bipedal control). We now discuss the transfer between multiple subscripts and linear indexing. His main research interest is low-latency computer vision applied to the autonomous navigation of visually-guided ground and flying robots. txt) or read online for free. Interests(Arduino, Rasp'pi, quad/bipedal control). 1 MATLAB R2015a installation - using central license server (windows) If you have downloaded all the parts of the iso-file, doubleclick on R2015a_win64_1. This may be useful for those who want to carry out matlab-based computations such as Dr. Select a Web Site. alpert_rule, a library which can set up an Alpert quadrature rule for functions which are regular, log(x) singular, or 1/sqrt(x) singular. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Find detailed answers to questions about coding, structures, functions, applications and libraries. c)Perform element-by-element multiplication on them. Select a Web Site. Could any one help me to do it for this small data so I can I apply to my data X 0. This may be useful for those who want to carry out matlab-based computations such as Dr. Please post your thoughts in a comment below (expected results and the reason, for the main code snippet above and its variants), and then run the code. · Forward Difference · Backward Difference · Central Difference. The goal of this demo is to showcase integration of C code in MATLAB and Simulink. Please fill out all required fields before submitting your information. Flow layout containers with support for horizontal alignment, inline-vertical alignment, and flow-direction (ltr/rtl) (see sui. An area chart displays a solid color between the traces of a graph. Blackjack Strategy Tester. Introduction. net is a resource for the technical computing and engineering community. Choose a web site to get translated content where available and see local events and offers. The aim is to obtain statistical inference from the given data in the paper of “(1977) Narula and Wellington, Prediction, Linear Regression and the Minimum Sum of Relative Errors, Technometrics” by using linear regression technique for prediction purposes. With the growth of Data science in recent years, we have seen a growth in the development of the tools for it. 1 Example a)Create two di erent vectors of the same length and add them. This document may also be used as a tutorial on camera calibration since it includes general information about calibration, references and related links. Please post your thoughts in a comment below (expected results and the reason, for the main code snippet above and its variants), and then run the code. However, several UCLA departments do offer Matlab to their associated affiliated Faculty, Staff or Students. R and Python have been steady languages used by people worldwide. In statistics, a central composite design is an experimental design, useful in response surface methodology, for building a second order (quadratic) model for the response variable without needing to use a complete three-level factorial experiment. Get support from 100,000 community members and MathWorks employees, and solutions from a pool of over 110,000 answered questions. Blackjack Strategy Tester. Control System Architect; Model Based Design, System Design & Verification, TCC, DO178, D0254. The central difference for a function tabulated at equal intervals is defined by. These inefficiencies are able to be solved by monitoring when a home uses hot water. Ask and find the best answers about MATLAB and Simulink. Trendy is a MATLAB Central application that scrapes a time series dataset from website(s) you specify. MatlabBGL is designed to work with large sparse graphs with hundreds of thousands of nodes. Welcome to the new Software @ Berkeley site! The Software website has a fresh new look and improved organization to help you quickly identify and access campus licensed software. It contains MATLAB implementations of various classical time-scale modification (TSM) algorithms like OLA, WSOLA, and the phase vocoder. Here i would like to share about matlab exchange where the matlab code files, applications related to matlab tool boxes can be freely obtained and also you can share your matlab files and application with this site. ###Functionality. This page covers basic OFDM transmitter chain viz. Hi I have a number of points (experimental data) plotted as an x-y plot. View the step-by-step solution to: Implement an EBMA with integer-pel accuracy using C or MATLAB. Kay Fitts Dept. Ask and Answer MATLAB Answers. Sharpen your programming skills while having fun!. Choose a web site to get translated content where available and see local events and offers. Contents: Introduction; MATLAB Versions; Matrices as Fundamental Objects; Matrix Operations; Assignment Statements; Case Sensitivity; Immediate and Deferred Execution. The 3 % discretization uses central differences in space and forward. This is a MATLAB program that takes in a csv file depicting a Blackjack playing strategy and outputs the house edge of that strategy and a graph of bankroll trend while playing using that strategy. It combines high-level language with a desktop environment suitable for iterative engineering and scientific workflows. View questions and answers from the MATLAB Central community. TSM toolbox. Beyond just analog and digital, FlexChannel inputs include Spectrum View. Select a Web Site. His main research interest is low-latency computer vision applied to the autonomous navigation of visually-guided ground and flying robots. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. computing finite difference weights. An email has been sent to verify your new profile. Work with your files from anywhere, share with others. Find detailed answers to questions about coding, structures, functions, applications and libraries. alpert_rule, a library which can set up an Alpert quadrature rule for functions which are regular, log(x) singular, or 1/sqrt(x) singular. Matlab R2018a Crack + License Key. Ask and find the best answers about MATLAB and Simulink. pdf), Text File (. EXE to unite the. This work presents a method of solution of fundamental governing equations of computational fluid dynamics (CFD) using Semi-Implicit Method for Pressure-Linked Equations (SIMPLE) in MATLAB ®. MATLAB + GIT in windows. Accelerating the pace of engineering and science. The latest Tweets from MATLAB (@MATLAB). An example to allow Matlab stand-alone developers to incorporate direct access to a relational database as part of their work. This service allows campus users to utilize a centrally funded, yearly, renewable, licensed copy of MathWorks MatLab on University owned or personal devices. However, several UCLA departments do offer Matlab to their associated affiliated Faculty, Staff or Students. Use a block size of 16 x 16. matlab code. Tektronix has done this for years. FlowBox, sui. Choose a web site to get translated content where available and see local events and offers. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Based on your location, we recommend that you select:. This is a MATLAB program that takes in a csv file depicting a Blackjack playing strategy and outputs the house edge of that strategy and a graph of bankroll trend while playing using that strategy. Ask and find the best answers about MATLAB and Simulink. Introduction. The central difference for a function tabulated at equal intervals is defined by. Find detailed answers to questions about coding, structures, functions, applications and libraries. include() However I'm surprised to find out that I can't seem to find any official documentation about it. Additionally, it is to get you used to using Matlab which you will use all semester. Book web site for Digital Image Processing by Gonzalez & Woods and for Digital Image Processing Using MATLAB by Gonzalez, Woods, & Eddins. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Description: kmeans algorithm is an iterative solution clustering analysis algorithm. 1 Basic Concepts in Matlab Michael G. I pretty much stick to R + JS for reproducibility, and Tableau for one-offs. CME 102 Matlab Workbook 2008-2009 5/55 1. In its simplest form, you pass the function you want to differentiate to diff command as an argument. how to create timeline plot?. The aim is to obtain statistical inference from the given data in the paper of “(1977) Narula and Wellington, Prediction, Linear Regression and the Minimum Sum of Relative Errors, Technometrics” by using linear regression technique for prediction purposes. PROBLEM STATEMENT. Matlab R2018a Crack + License Key. Choose a web site to get translated content where available and see local events and offers. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Discover Live Editor. Cody is a MATLAB problem-solving game that challenges you to expand your knowledge. This is the code for the paper " PCA based Edge-preserving Features for Hyperspectral Image Classification, IEEE Transactions on Geoscience and Remote Sensing, 2017, 55(12), 7140-7151. 2 Finding Numerical Solutions MATLAB has a number of tools for numerically solving ordinary differential equations. His main research interest is low-latency computer vision applied to the autonomous navigation of visually-guided ground and flying robots. FlowBox, sui. It can be run both under interactive sessions and as a batch job. Please fill out all required fields before submitting your information. Find detailed answers to questions about coding, structures, functions, applications and libraries. Trendy is a MATLAB Central application that scrapes a time series dataset from website(s) you specify. MathWorks est le principal éditeur de logiciels de calcul scientifique et technique, pour les ingénieurs et les scientifiques. Choose a web site to get translated content where available and see local events and offers. Matlab Central Already in previous post i described about matlab and related engineering projects and application. Ask and Answer MATLAB Answers. All current windows scopes MSO/DPO5000 Series or higher have MATLAB integration into the Data Store (direct internal memory access) to which we have an Application Development Kit (ADK) that allows people to write apps using the user interface and option SR-CUST allows people to write custom decoders right into the Tekscope app. This may be useful for those who want to carry out matlab-based computations such as Dr. Based on your location, we recommend that you select:. Blackjack Strategy Tester. Learn more about timeline, plot. PROBLEM STATEMENT. Finite Difference Method using MATLAB. ) One of these languages is MATLAB, but I can't seem to find a YAML lib. View questions and answers from the MATLAB Central community. This post is the result of an online conversation about tidal ellipses and how to compute them in Python. This section of MATLAB source code covers OFDM transmitter and OFDM receiver basic chain coded in matlab. MathWorks is the leading developer of mathematical computing software for engineers and scientists. The best place to learn about MATLAB and Simulink from the experts at MathWorks | MATLAB Central Blogs. MATLAB Answers™ provides a collaborative environment for finding the best answers to your questions about MATLAB, Simulink, and related products. Select a Web Site. Choose a web site to get translated content where available and see local events and offers. He is the founder and director of the Robotics and Perception Group. Based on your location, we recommend that you select:. Could any one help me to do it for this small data so I can I apply to my data X 0. Find the best answers about MATLAB, Simulink, and related products. Beyond just analog and digital, FlexChannel inputs include Spectrum View. An email has been sent to verify your new profile. 2 Finding Numerical Solutions MATLAB has a number of tools for numerically solving ordinary differential equations. Welcome to the new Software @ Berkeley site! The Software website has a fresh new look and improved organization to help you quickly identify and access campus licensed software. binary data source,data mapping,IFFT,CP insertion. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Accelerating the pace of engineering and science. Use a block size of 16 x 16. matlab code. This post is the result of an online conversation about tidal ellipses and how to compute them in Python. MATLAB Central - File Exchange Pick of the Week » Finding the Best Distribution That Fits the Data - Free download as PDF File (. Interests(Arduino, Rasp'pi, quad/bipedal control). The purpose of this exercise is to demonstrate the central limit theorem that is critical to the formation of white Gaussian Noise. We will be using the same data from previous posts. MATLAB Central contributions by Banister. We have multiple avenues. MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourth-generation programming language which is frequently being used by engineering and science students. MATLAB Central contributions by Nicky. MAT-Fly provides an easy to use 3D simulation scenario based on MATLAB and the MathWorks Virtual Reality (VR) toolbox that work together to. If you find any mistakes or bugs in the code please let me know. Ask and Answer MATLAB Answers. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Ask and find the best answers about MATLAB and Simulink. Related MATLAB, Maple, Mathematica, LaTeX, Etc News on Phys. pdf), Text File (. Select a Web Site. Students, faculty and staff on all three U of I campuses - Urbana-Champaign, Chicago, and Springfield - are eligible to receive significant discounts on over 350 software applications and software training courses offered by the U of I WebStore. MatlabBGL is designed to work with large sparse graphs with hundreds of thousands of nodes. The best place to learn about MATLAB and Simulink from the experts at MathWorks | MATLAB Central Blogs. 2 Finding Numerical Solutions MATLAB has a number of tools for numerically solving ordinary differential equations. This work presents a method of solution of fundamental governing equations of computational fluid dynamics (CFD) using Semi-Implicit Method for Pressure-Linked Equations (SIMPLE) in MATLAB ®. Matlab programming language is exceptionally straightforward to use. b)Now subtract them. Hi I'm trying to find out how to create a module in Matlab, that can be called using module. MathWorks est le principal éditeur de logiciels de calcul scientifique et technique, pour les ingénieurs et les scientifiques. Based on your location, we recommend that you select:. こんにちは、井上です。梅雨の季節は保育園の送り迎えが大変です・・。 今日は Lightning Talk @ MATLAB EXPO 2019 発表者特集第二弾として、 MATLAB 擬人化キャラでインパクトを与えた わたなべ @mana_544 様のご紹介。. TSM toolbox. Worsley's FMRISTAT or Gang Chen's 5-way ANOVA or user cuddly 3dDeconvolve. It started out as a matrix programming language where linear algebra programming was simple. Select a Web Site. Accelerating the pace of engineering and science. MATLAB Central gives you support and solutions from over 100,000 community members and MathWorks employees. Ziad Saad and Gang Chen have developed a package of Matlab functions to read, write, and process AFNI datasets. Ask and Answer MATLAB Answers. OFDM MATLAB Code. View questions and answers from the MATLAB Central community. It would certainly be a weird, unhelpful question if the prospect has no interest in other languages and can get the same results in their language(s) of choice. This may be useful for those who want to carry out matlab-based computations such as Dr. matlab code. This page contains some of the Matlab code I've written during the course of my research. Central Difference. Matrix generation is the most important factor on matlab because which is the basic elements of matlab environment. PROBLEM STATEMENT. It contains MATLAB implementations of various classical time-scale modification (TSM) algorithms like OLA, WSOLA, and the phase vocoder. Ask and find the best answers about MATLAB and Simulink. Kay Fitts Dept. Select a Web Site. Davide Scaramuzza is Professor of Robotics at the University of Zurich. how to create timeline plot?. In statistics, a central composite design is an experimental design, useful in response surface methodology, for building a second order (quadratic) model for the response variable without needing to use a complete three-level factorial experiment. Use a block size of 16 x 16. These inefficiencies are able to be solved by monitoring when a home uses hot water. 1 MATLAB R2015a installation - using central license server (windows) If you have downloaded all the parts of the iso-file, doubleclick on R2015a_win64_1. Andrew Patton's Matlab code page. Flow layout containers with support for horizontal alignment, inline-vertical alignment, and flow-direction (ltr/rtl) (see sui. If you want to calculate the first derivative of a single variable function, then the simplest way is to use the Matlab gradient function.