# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

765 questions
Filter by
Sorted by
Tagged with
82 views

### Solving condensate density problem in MATLAB

I want to solve for $n_{0}$ for a fixed value of $n$, lets say $n=1$ $$n= n_{0}+ \dfrac{1}{2}\int_{-1/2}^{1/2}dq\left(\dfrac{e_{q}+Un_{0}}{\hbar\omega}-1\right)$$ where $e_{q}=2[1-cos(2\pi q)]$ ...
302 views

### Why do structured and unstructured discretizations give different errors?

It is necessary for me to solve a Poisson problem with a numerical method on a square domain with two types of triangular mesh: uniform triangular mesh (using uniform distribution nodes on square) and ...
647 views

### Interpolating 3D Array non-monotonic data in MatLab

I am working on creating a program for simulations where three variables are parametrized, and we modify one parameter while keeping the other two constant. An example array looks like this when ...
621 views

### Dirichlet boundary condition

I am trying to solve ODEs in matlab using ode15s. Instead of specifying ODEs in the format M * dC/dt = f(C,t) where C is a function of x and t. I want ...
104 views

### For loops in matlab with a specific starting point

I have the following definitions long = 1000; init = 500; N = init+long; T = init+1:N-1; T1 = init+2:N; I then fill the vectors ...
211 views

717 views

### eigs routine in octave [closed]

I am using octave and observed a problem with the eigs-routine for non symmetric matrices. Using GNU octave version 3.8.1 the code below gives significant difference of eigenvalues although same ...
1k views

### Difference between eigendecomposition and singular value decomposition for Hermitian matrices

Let consider the following Hermitian matrix ...
1k views

4k views

### Determine unit outward normal vector for a curve

It is necessary for me to find the unit outward normal vector for the curve: $$\gamma=(x(t),y(t))$$ where $$x(t)=\cos(t)−0.5\cos(3t)$$ and $$y(t)=\sin(t)+\sin(7t)+\sin(3t)$$ I know how to find ...
168 views

### How to construct the matrix like this

"We consider an unstructured planar (undirected) graph and calculate the stationary probability distribution of the random walk on the graph. The graph is generated by choosing n random points in the ...
945 views

### Searching solution for solving huge linear system in MATLAB or C

I am encountering a problem that my MATLAB code ran and an error occurs and shows that it is out of memory. My code is using finite element method to solve some complicated kind of integral equation ...
312 views

### ARPACK gives different answers from Matlab and NAG

I'm playing with ARPACK. I looked into the examples they provide, zndrv4.f illustrating the usage of the routine znaupd, in the directory of ARPACK/EXAMPLES/COMPLEX/. I also came cross NAG Fortran ...
108 views

### What is the best method to combine multiple vectored results into one chart?

Currently I am working on my research report where I've done a lot of measurements. For now I have uploaded everything into Matlab and visualise each on chart. Each one consists of 4 lines drawn with ...
413 views

### how to pick a submatrix of a sparse matrix quickly(matlab)

I have a large sparse matrix A and i want to pick the submatrix of it to do block jacobi iterations. For the blocks, i have get a matrix Q that contains the index of nonzero entries in its Jth column ...
2k views

2k views

### 2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
1k views

### Scaling factor of the inverse Fourier Transform (for convolution purposes)

I have a certain 2-D function. More properly, I have not the function itself, but the matrices $[X,Y,Z]$, where $X,Y$ are $1\times n$, and $Z$ is $n \times n$. Now, I want to calculate a a new matrix,...
292 views

208 views

### How to write a function-generating code in Python/MATLAB?

I want to write a code that generates a function I(t) that satisfies the following condition: $\frac{\big<I(t)^2\big>}{\big<I(t)\big>^2} > 2$ In other words, \$\frac{\lim_{T \to \...
241 views

### single-variate function variational Intensity Plot for Matlab

I'm wondering if it's possible to create functional intensity plots in matlab. Examples of what I'm looking for are below found in this paper: These figures were (guessing) probably made in R, but is ...
5k views

### Plot a surface from data sets in MATLAB

I tried to plot a surface in MATLAB but, since it is the first time I had to do something like this, I need a confirmation on the process I followed because it is important for my project to plot the ...
3k views

### Numerical integration and filtering of acceleration experimental data

I have a vector containing acceleration measurements and the corresponding vector of times in which measurements are taken. To obtain velocity and displacement I used the cumtrapz() function already ...