Perform classification using discriminant analysis, naive Bayes classifiers, and decision trees. Suppose you have a data set containing observations with measurements on different variables (called predictors) and their known class labels. If you obtain predictor values for new observations, could you determine to which classes those…
Counterparty Credit Risk and CVA
Compute the unilateral credit value (valuation) adjustment (CVA) for a bank holding a portfolio of vanilla interest rate swaps with several counterparties. CVA is the expected loss on an over-the-counter contract or portfolio of contracts due to counterparty default. The CVA for a particular counterparty is defined as the sum over all points in time of…
Modeling the United States Economy
Economists and policymakers are concerned with understanding the dynamics of economies, especially during periods of significant macroeconomic shocks. Although numerous approaches are possible, we will develop a small macroeconomic model in the style of Smets and Wouters.
Portfolio Optimization Examples
The following sequence of examples highlights features of the Portfolio object in the Financial Toolbox™. Specifically, the examples show how to set up mean-variance portfolio optimization problems that focus on the two-fund theorem, the impact of transaction costs and turnover constraints, how to obtain portfolios that maximize the Sharpe ratio,…
This example shows how to use Simulink® to model a quadcopter. It uses Simulink® Projects to manage the model and source files. This example provides an implementation of the Flight Simulation application Template for the collaborative development of a flight simulation application.
Designing a Guidance System in MATLAB and Simulink
This example shows how to use the model of the missile airframe presented in a number of published papers (References ,  and ) on the use of advanced control methods applied to missile autopilot design. The model represents a tail controlled missile travelling between Mach 2 and Mach 4, at altitudes ranging between 10,000ft (3,050m) and 60,000ft (18,290m), and with typical angles of attack ranging between +/-20 degrees.
This product allows users to interactively design a tabular expression. The resusulting function can be saved as a Simulink block or to a Matlab m-file. Tabular Expressions can be proved to be disjoint and complete using the PVS theorem prover. This allows users to ensure that the table they are designing has covered all possible inputs and is deterministic.
Demo file for batchpleas.m
batchpleas is a wrapper for lsqnonlin, allowing it to solve many small problems (all with the same parameterization) in one batched, partitioned nonlinear least squares estimation. This takes advantage of economies of scale, so as to gain a higher throughput overall. The gain can be dramatic.
Computational cost for Cramer's rule
There are plenty of direct and iterative methods to solve a linear algebraic system of equations. Using Cramer's rule, one can easily obtain the solution for small systems by hand. However, with the growth of the unknowns, the method becomes computationally very expensive. Moreover, calculating a determinant by its definition may result in overflow or underflow if someone wanted to apply it on a computer. That is why Cramer's algorithm is not applied in computations.
Single Hydraulic Cylinder Simulation
This example shows how to use Simulink® to model a hydraulic cylinder. You can apply these concepts to applications where you need to model hydraulic behavior. See two related examples that use the same basic components: four cylinder model and two cylinder model with load constraints.
Modeling a Fault-Tolerant Fuel Control System
This example shows how to combine Stateflow® with Simulink® to efficiently model hybrid systems. This type of modeling is particularly useful for systems that have numerous possible operational modes based on discrete events. Traditional signal flow is handled in Simulink while changes in control configuration are implemented in Stateflow. The model described below represents a fuel control system for a gasoline engine. The system is highly robust in that individual sensor failures are detected and the cont
Anti-Windup Control Using a PID Controller
This example shows how to use anti-windup schemes to prevent integration wind-up in PID controllers when the actuators are saturated. We use the PID Controller block in Simulink® which features two built-in anti-windup methods, back-calculation and clamping, as well as a tracking mode to handle more complex scenarios.