# Questions tagged [matlab]

For mathematical questions about MATLAB; questions purely about the language, syntax, or runtime errors would likely be better received on Stack Overflow. MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks.

2,600 questions
27 views

### fractional imaginary calculation

Assume $j=\sqrt{-1}$, to calculate $(-3.1416j)^{0.5}$ in Matlab, I type (j*-3.1416)^0.5 and it gives me the result: ...
139 views

### Crank-Nicolson code for in-situ combustion model (MATLAB)

I need to solve in MATLAB the following system (1): \begin{align} &\frac{\partial \theta}{\partial t} + u \frac{\partial (\rho\theta)}{\partial x} = \frac{1}{\text{Pe}_T} \frac{\partial^2 \...
26 views

### How to simplify exponential matrix complex output in MATLAB?

I want to use MATLAB to find $e^{\mathbf{A}t}$ for $$\mathbf{X'}=\begin{pmatrix} -3 & -1 \\ \phantom{-}2 & -1 \end{pmatrix}\mathbf{X}$$ this is what I wrote in the command window ...
26 views

### Plotting basis vectors of a 3D local coordinate system defined by a homogenous transform

Given a 4x4 homogenous transform $H$ I know that the first three columns of $H$ (ignoring the last row) define the basis vectors of the 3D coordinate system that it moves its "parent" coordinate ...
19 views

### Estimating probability density function of big amount of data coming from Monte Carlo simulation

I am trying to estimate Probability Density Function (PDF) of a big amount of data ($1e^6$ , $1e^7$, and higher) coming from Mote Carlo (MC) simulation. My objective is to estimate the PDF (e.g. with ...
37 views

### Plots in MATLAB

Is it possible to generate by MATLAB, plots and subplots like the ones below? The plots come from an economics paper (http://people.bu.edu/sgilchri/research/GSSZ_FHMU.pdf) and I have looked at ...
63 views

### How does MATLAB compute the real Schur decomposition?

Let matrix A be defined as ...
20 views

### Fredholm determinant

Suppose we have a Jacobi unitary ensemble $W$ with eigenvalues $-1<\lambda_{1}\leq \lambda_{2}\leq \cdots\leq \lambda_{n}<1$. We can express the eigenvalue correlations near $1$ in terms of the ...
32 views

### How to find a non-singular sub-matrix in a full-rank matrix.

Suppose we are given $A\in\mathbb{R}^{n\times m}$, where $n<m$, and we know that $A$ is a full-rank matrix. What is a simple and efficient way to find any submatrix $B\in\mathbb{R}^{n\times n}$ ...
40 views

### Want to compute product of Bessel and Hankel function in Matlab - $J_m(x)\cdot H_m^{(1)}(y)$ - but large order or argument returns 'inf'?

I am trying to compute (in Matlab) the product of a Bessel function and a Hankel function where the order $m$ of the functions may be very large and/or the arguments $\alpha x$ and $\alpha y$ of the ...
8 views

### BVP with intermediate constraints (Multipoint BVP?)

I have a scalar BVP in the form $$\ddot{n}(t) = f(n(t),\dot{n}(t),t)$$ with BCs $\dot{n}(0) = \dot{n}(t_f)=0$. In addition to these BCs, I have constraints on velocities as $\dot{n}=0$ at ...
18 views

### Is there mistake in derivation/simulation of Maximum A Posterori (MAP) estimation?

I'm trying to estimate $X$ using MAP Estimator. If $Y = aX + N$, where $a$ is a constant, $X \sim \mathcal{N}(0,\sigma_{x}^{2})$ and $N \sim \mathcal{N}(0,\sigma_{n}^{2})$. The likelihood function ...
7 views

### 2D Meshing of an Arbitrary Polygon in Matlab

I am trying to create meshing for an arbitrary polygon; such as, ...
11 views

45 views

### Making a animation in Matlab, timedependent function $T\mapsto R_T$

I am dealing with the Pontryagin-Maximum-Principle and i calculated the so called reachable set $R_T$. I am using the following code that plots the reachable set for a certian endtime $T$: ...
62 views