# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

600 questions
206 views

### Solving a differential equation using numerical methods and matlab

(a) Consider the following differential Equation $$Y'(t)=\frac{1}{1+t^{2}}-2[Y(t)]^2$$ $$Y(0)=0$$ The exact solution is $$Y(t)=\frac{t}{1+t^2}$$ Using the Euler method to solve the following ...
460 views

### Matrix Balancing Algorithm

I have been writing a control system toolbox from scratch and purely in Python3 (shameless plug : harold ). From my past research, I have always complaints about ...
61 views

### Solving ODEs of Switched Systems using MATLAB ODE suite

I have the following code to execute: $X$ = [0;0;0;0]; $sw$ = 0; ...
743 views

Im currently implementing a Nelder-Mead algorithm in MATLAB that can deal with constraints. In detail, the constraints should be added to the objective function with a Lagrange Multiplier($\lambda$) ...
302 views

### Defining a pixel neighborhood in an array in MATLAB

I am working with matrix operations in MATLAB, and I would have the following problem. I have matrix containing zero elements: a=zeros(100,100) and another ...
131 views

I need to numerically evaluate 2-D integrals of the form: $$\mathcal{I}(\theta) = \int_{0}^{1} \int_0^1 \varphi_\theta(x,y) dx dy$$ where $\varphi_\theta$ is a family of smooth functions indexed by ...
59 views

### Name of third-party Matlab packages for solving PDEs

I am interested in working with systems of PDEs in two spatial dimensions, as part of a mathematical modeling project. The systems of PDEs are coupled, and there is no convenient reduction to 1 ...
790 views

### Use Monte Carlo method to simulate consecutive decay in MATLAB

I'm trying to use MATLAB to simulate an atom decay process by using Monte Carlo approach. The process is as follow: Suppose that atom 1 decay to atom 2, which, in turn, decay to stable atoms of type ...
87 views

### Adjoint of the MATLAB $\tt dwt3$ (3D wavelet transform) operator

How do I compute the adjoint of MATLAB's dwt3 operator? In other words, how do I compute the adjoint of the linear operator that takes a 3D complex array ...
100 views

### Numerical Integration [duplicate]

Let $\alpha=1.714$ and $\lambda=-v(1-v^{\alpha})/\alpha$, where $0<v<1$. Consider $\phi(v)=\exp\{\int_{v_{0}}^{v}\frac{1}{\lambda(t)} dt \}$, where $0< v_{0} <1$ is an arbitrary chosen ...
102 views

### Data cloning into 3D matrix

I am working with MATLAB, and I would have the following problem. I have the following matrix of random numbers rand(200,200) and I need to create a 3D matrix ...
157 views

673 views

### Difference between Data structure objects and cell array objects in matlab

I want to know what are the differences between two data structures in MATLAB: Structure Arrays and Cell Array. In what circumstances we can use each of them?
73 views

### Need help writing the code for the following optimization

I need to find $X$ for which the following expression is minimized: $$\min ||Y - F^{-1}(X)||_2 + ||X||_1$$ where $Y$ is an array (of length approx 44000, an audio sample I will be reading using ...
137 views

67 views

### Handling figures built for different parameters in Matlab

I couldn't find a simple answer to this thing I'm trying to do in Matlab. I have a function file that does some calculation for a given parameter a: ...
111 views

### Scaling a vector-valued non-linear function for numerical optimization/minimization

I am trying to minimize a non-linear vector-valued function in MATLAB. As a test case for my code, I try to minimize a function whose solution I know apriori. The problem is that one of the ...
51 views

### MATLABs double arithmetic

this is a classical problem, but I need help to pinpoint what I am missing. Problem: In MATLAB (exp(1) + 10^12) - 10^12 gives you a double which equal to e, up to 5 correct digits. But I thought ...
541 views

### How to solve a set of 1st order 1D PDEs in Matlab?

i have already asked something similar to this once but sadly i wasn't able to get a complete answer, so i remain stuck on this problem. the Matlab function pdepe seems to only be able to solve 2nd ...