# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

762 questions
Filter by
Sorted by
Tagged with
2k views

### Does OOP work easily and efficiently in parallel computations? [closed]

I am working on a task for which the object oriented (OO) approach fits well. I am doing it in MATLAB, since I am in the prototyping phase. However, I know that later I will surely have to perform ...
166 views

### MATLAB : Does the qr algorithm and the DGEMM used in MATLAB take into account if the input matrix is tridigonal and optimize accordingly?

Let's say we want to solve for the eigen-values of a symmetric matrix of size $n$ x $n$. In the Phase 1 of the computation, the matrix is reduced to a tridigonal form using Householder/Arnoldi's ...
1k views

### matrix storage, many rows or many columns?

tl;dr Should I store a matrix of Nx3 elements row-wise or column-wise, if I'm going to access 3 elements at a time? Does it matter? I'm setting up a numerical simulation with matrices of x,y,z ...
2k views

### Finding rate of convergence by curve fitting in Matlab

I have some data: number of nodes $N$ and error in energy norm corresponing to it. I have seen in some references that the rate of convergence is reported by $$\| u-u_h\| _E=CN^{\alpha}$$ How can ...
137 views

### Matlab Vectorization of columns in a 2D matrix and single element multiplication

MATLAB. I am trying to vectorize a loop in which each column vector of a 2D matrix (n-by-n) is found by multiplying each single element in a diagonal matrix with a column vector in another n-by-n 2D ...
81 views

### How can I use ODE events in MATLAB? [closed]

I need to have a better understanding about how to define ODE events. What I know is that if I have my ODE defined as ...
1k views

### Solving DAE with higher index

I want to solve 7 coupled differential equations in MATLAB. I used the method of lines (MOL) to convert them to a system of DAEs. I then attempted to solve this system using ode15s. Unfortunately an ...
472 views

### Computing solutions with singularities using MATLAB ODE45

I am new to solving numerically ODES and thus it is difficult for me to judge the reliability/trustworthiness of the results that I have produced for the following problem: I am dealing with a 2nd ...
2k views

### How can one describe the accuracy of a Runge-Kutta method?

I am solving a nonlinear ODE with a regular singularity using MATLAB ODE45 or ODE113. I am wondering what precision and accuracy they have and what one can say about the numerical error. The idea ...
253 views

### ODE events to switch between 5 equations (friction model)

I am modelling a 1 dof spring-mass-damper system with friction. As first attempt I modelled the friction according to the simple Coulomb model (figure A here http://article.sapub.org/image/10.5923.j....
223 views

### Approximate function following interpolation (Matlab)

How do you approximate a function for interpolated points? I use the natural cubic spline to interpolate points as follows for n = 500 points: ...
458 views

183 views

### What is the meaning of this error in MATLAB?

Warning: Failure at t=6.137539e-04. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.734723e-18) at time t. In ode15s (line 730) In ...
4k views

### Having smoother contour plots in MATLAB

I have a $80\times200$ matrix, and I want to plot its contents with the contourf command in MATLAB, as follows: \begin{align} &\text{[C,h] = contourf(mat,100);}\\ &\text{set(h,'LineColor','...
76 views

### Finite difference for Lighthill source term

I have experimental data containing horizontal and vertical components of speed and I need to evaluate this: $$\frac{\partial^2}{\partial x_i \partial x_j}\left(v_iv_j\right)$$ Denoting $U$ as ...
408 views

### QR decomposition

I have a matrix which is "almost" like an upper triangular just that the last row has non zero elements. And I want to perform the QR decomposition on that matrix. Does anyone know the "name" of such ...
558 views

### Generation of random Matrix with Real eigen values

does anyone know any matlab algorithm that can help me generate a random matrix with REAL EIGEN values? Thanks.