# Questions tagged [matlab]

Questions about the numerical programming language MATLAB.

600 questions
216 views

### Given x,y,z data of a periodic object, calculate the period of the object (if possible)

So the problem I am working on is as such. Given the x,y,z data of a periodic object over time (from the origin in 3d space) (need not be uniform), calculate the period of the object (if the data ...
131 views

### Spectrum of the Laplace operator

I am studying the discretization of Poisson's equation in $1D$. In Matlab I created different discretization matrices (Laplace operator) according to different sizes of the mesh: ...
63 views

### Is MATLAB feasible for app deployment versus lower level languages [duplicate]

MATLAB/Octave is a pretty useful language for prototyping scientific computation use cases, however I would like to know if the sheer nature of being a high level language bottlenecks how fast the ...
273 views

### Inputting a time dependent function into ODE45 [closed]

I am currently trying to model random waves on a buoy system. I am running into the issue of implementing a random wave function. ...
917 views

### Practical coding resources for new CFD practicioners

There seem to be many books and papers that explain various CFD methods in great detail, but unfortunately I have not been able to find many good resources of such methods implemented in codes such as ...
121 views

### How to implement chaotic sender and receiver with ordinary differential equations?

I am referring this paper, and trying to implement chaotic sender and receiver, to decode message, as given in section $V^{th}$ Chaotic signal masking. The process that I want to implement is figure ...
149 views

### Any FOSS MATLAB/Octave toolbox for high-speed variable precision arithmetic?

I need to use variable precision arithmetic in MATLAB for an expensive set of computation. The vpa function provided by the symbolic math toolbox is very slow. I found a non-free alternative toolbox ...
38 views

### Optimisation of purely integer quantity with bound-constraints for a 1D expensive function whose analytical form is not available

I have a computationally expensive objective function, whose analytical form is not available. The only input argument to the objective function is an integer variable. The goal is to compute the ...
125 views

### How to Apply a Uniform Load to a Laminate Plate in FEM

As the title says, I'm trying to make my code include a uniform pressure/force to the surface of a plate for analysis. Structural/Element Modeling I am modeling a 2D 9 node Mindlin plate that has a ...
97 views

### Obtaining extra output argument(s) from the objective function used by fsolve in MATLAB

I have a MATLAB code (see below) that employs 'fsolve' from the optimization toolbox for a root finding problem. The bottleneck is that, within the objective function calculation, there is a ...
582 views

### How to get multiple solutions for a optimization problem using any kind of software

I have a optimization problem in which the optimal objective value occurs at multiple point in the feasible space. If I run my problem in LINGO software then it gives me the optimal objective value at ...
598 views

### Edge and Nodal finite element methods in MATLAB for Magnetic induction tomography

What is the difference between edge finite elements and nodal finite elements? This for use in modeling the eddy current problem in classical electromagnetism. I am attempting to convert MATLAB code ...
110 views

### Error Reduction algorithm for single measurement intensity [closed]

I'm trying to solve the phase problem from single intensity measurement. I implemented error reduction algorithm in Matlab for ...
232 views

### matlab lsqcurvefit parameter estimation journey

The lsqcurvefit solution in matlab converges at different solutions depending upon the initial guess: Surface represents the error (SSE) between model and data at various combinations of parameters ...
2k views

### BLAS libraries for Octave or Matlab, preferrably with GPU support?

I just searched around a bit for BLAS implementations and was amazed by the sheer amount of libraries around. Does someone know of a benchmark or otherwise rating of the various libraries? How easy ...
96 views

### Numerically compute PDF given a function

Consider $[0,1]$ with the Lebesgue measure $m$ and $f:[0,1]\to \mathbb{R}$, and $x$ a uniformly distributed random variable in $[0,1]$. Then, $f(x)$ itself define a new random variable. We can then ...
190 views

143 views

### How to complete sparse matrix?

I am trying to solve an equation by a meshfree method. Shape functions (and their derivatives) have a compact support domain. So, over a given integration cell used for numerical integration, only a ...
730 views

### Solving poisson equation on image with neumann boundary condition

I am trying to solve a standard Poisson equation on image with Neumann boundary condition. The Poisson equation has the form: $Δp=b$ where $b$ is the divergence of the input image,which is as shown: ...
2k views

705 views

### Efficiently computing the product of a multi-dimensional matrix (or tensor) and vectors

Update: Thank you very much for all of you who answered below. I'm studying each answer now. In the long term, I'm more interested in solutions that work for sparse tensors (sorry I should have ...
5k views

### Implementation of the Jacobi iteration to find the solution to $Ax = b$

I implemented the Jacobi iteration using Matlab based on this paper, and the code is as follows: ...
35 views

### Solving HJ using Hopf-Lax formula (Burgers case)

Hi I want to approximate $u(x,t)$ solution of: $\begin{cases}u_t+H(u_x)=0 \\u(x,0)=u_0(x)= e^{−(x−3)^2} \end{cases}$, where $H(u_x)=\frac{u_x^2}{2}$ and my spatial domain is $\Omega=[0;10]$. Now i ...
393 views

### Find a permutation matrix (using the Matlab's function $symrcm$) of a matrix $A(2:end, 2:end)$

I've the following Matlab code: r = symrcm(A(2:end, 2:end)); prcm = [1 r + 1]; spy(A(prcm, prcm)); where A should be sparse ...
263 views

### Pool two computers for MATLAB parfor without MDCS

I have two identical computers, both with 4 dual cores and MATLAB installed on them. They are connected to the same network. Is there anyway I can run a parforloop using the computation power of both ...
I would like to program the following difference equation. Find numbers $v_{i,j}$ so that for $1\leq i\leq 4$, $0\leq j\leq 5$: $$v_{i,j+1} = (0.1)v_{i+1,j} + (0.8)v_{i,j} + (0.1)v_{i-1,j}$$ In ...