# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

761 questions
Filter by
Sorted by
Tagged with
84 views

### MATLAB: Matrix whose elements depend on its indicies

I am trying to put the function $$f(\mu,\nu) = i^{\nu-\mu} \sum_{0}^{19} H_{\mu-\nu}(7j) + \delta_{\mu,\nu}\ ,$$ $\mu, \nu =-3,-2,...2,3$ into a 7x7 matrix, where $H$ is the Hankel function of the ...
2k views

### 3D Solid 8 Node FEM Matlab Code

So this semester, I'm taking a Finite Element Method course at my graduate school. We started out making codes for 1D bars and came all the way to 8 node solid elements. However, I seem to have run ...
200 views

394 views

### Contour plot of a scalar function over the complex domain in MATLAB

I'm trying to make a 2D contour plot of a function with a complex input and a real output, namely: $f(z=x+iy)= |z^2-3z|$, on MATLAB. I want to make a contour plot of f, such that the axes are $(x,y)$, ...
122 views

### Numerically Approximate $[n\cdot\nabla u_h],$ without using Matlab function

Suppose that $\Omega\subset\mathbb{R}^2$ and we define the triangulation $\mathcal{T}_h$ where, $$\mathcal{T}_h=\bigcup_{i=1}^nK_i$$, with $K_i$ are triangles. We have the explicit a posteriori ...
1k views

### Matrix of linear transformation in MATLAB

How can I determine a matrix $R$ in matlab such that, given a known matrix of coefficients $A$ gives me back its row reduced echelon form? Obviously I need an algorithm/function that works also with ...
463 views

### Matlab: ode45 loop

I have to solve this equation $$\ddot{x}x = -\frac{3}{2}\dot{x}^2 + \frac{\dot{x}}{h} + \sin(t)$$ where $h$ is defined by $$h = \left(\frac{\dot{x}}{h}\right)^{1/3} + \frac{\dot{x}}{h}$$ My idea ...
214 views

### Integrate result of finite element calculation in MATLAB

I have a PDE that I solve in MATLAB over a 2D domain using the "recommended workflow", i.e. the functions descg, ...
386 views

### Which ODE solver in Matlab allows me to advance in just one timestep only

[t,y] = odeXX(odefun,tspan,y0) I have a solver odeXX, and the tspan = [0 0.0001]. It seems that for any ode solver in MATLAB, they integrate by breaking ...
164 views

2k views

### Faster code for double integration using Gauss-Legendre quadrature

I came with a the following code to evaluate a double integral using Gauss Legendre quadrature in MatLab ...
248 views

### How to form the stiffness matrix for the Poisson equation using a spectral method

This is a follow-up question to How do I form the Chebyshev differentiation matrix in MATLAB? The goal of the following code is to solve the Poisson problem: ...