# Tag Info

## Hot answers tagged matlab

68 votes
Accepted

### why is A*v+B*v faster than (A+B)*v?

Except for code which does a significant number of floating-point operations on data that are held in cache, most floating-point intensive code is performance limited by memory bandwidth and cache ...
• 18.5k
23 votes

• 11.4k
11 votes
Accepted

### Generate random smooth 2D closed curves

Since your figure is a closed loop, its parametric curves $x(t)$ and $y(t)$ must be periodic functions. This suggests one way to generate such figures, by constructing random smooth periodic functions ...
• 4,822
10 votes
Accepted

### How does gmres method iteration behave for this non-diagonalizable matrix?

Unfortunately, convergence of GMRES does not have a clear dependence on the distribution of eigenvalues. It was proved by Greenbaum, Ptak and Strakos in 1996 that you can construct examples with an ...
• 11.1k
9 votes

### Nonlinear eigenvalue problem - MATLAB code

Given a nonlinear eigenvalue problem of the form $A(\lambda)x = 0$, reducing it to a real equation $\det(A(\lambda))=0$ is known to be a poor method for just the reason you've discovered yourself. The ...
• 11.4k
8 votes
Accepted

### Numerically computing the advection equation

I see several issues: The DFT computed with fft puts the zero mode at the beginning of the array, and if you want to compute the derivative, it is necessary to ...
• 11.4k
8 votes
Accepted

### How to solve the problem without using symbolic computation

You can solve this numerically in Python without symbolic computation. from __future__ import print_function, division import numpy as np from numpy import exp from scipy.integrate import quad from ...
8 votes
Accepted

### Computational time not proportional to integration interval in ODE-solver?

Substantially edited, since the original poster changed his equation... In general, the MATLAB (and Octave) ODE solvers dynamically adjust the step size as needed to maintain an accurate solution. ...
• 18.5k
8 votes
Accepted

### ODE45: doubts about the result. Correct or not?

I ran your same code in Python ...
• 8,370
8 votes

### What is the difference between MATLAB and FORTRAN?

In general, you will be much more productive writing software in a higher-level language (e.g MATLAB) that has features useful in describing problems in your particular domain (e.g. matrices in ...
• 5,974
8 votes

### In Matlab, how can I be consistent with units?

Just simply by being consistent in all of my code? Yes this is the only way. Matlab or any other programming language does not know about units. They only know about numbers. As an example consider ...
• 2,993
8 votes
Accepted

### In Matlab, how can I be consistent with units?

I would say that you have, mainly, two methods: Being consistent in all your code, as already suggested in another answer. For that purpose, I always keep a table like this one with me, since it ...
• 8,370
8 votes

### Numerical stability of higher order Zernike polynomials

A possible solution (suggested by @gammatester) is to use Jacobi polynomials. This circumvents the problem of catastrophic cancellation in adding the large polynomial coefficients by 'naive' ...
• 273
8 votes
Accepted

### How to compute all the eigenvalues of a large sparse matrix using matlab?

"Get more RAM" may be one of your best options. :) Prices are reasonably low right now, and it's one of the best upgrades you can gift your computer anyway. 10k x 10k is borderline but still doable ...
• 11.1k

Only top scored, non community-wiki answers of a minimum length are eligible