Questions about the numerical programming language MATLAB.

learn more… | top users | synonyms

0
votes
0answers
38 views

Oscillating convergence in my Resilient BackPropagation (RPROP) implementation

I have implemented in matlab a neural network that uses rprop's algorithm to update its weights. Strangely the error on the training set does not converge to a local minimum, but oscillates. Here is ...
0
votes
0answers
27 views

Oscillating convergence plot in my Resilient BackPropagation (RPROP) implementation [duplicate]

I have implemented in matlab a neural network that uses rprop's algorithm to update its weights. Strangely the error on the training set does not converge to a local minimum, but oscillates. Here is ...
0
votes
0answers
28 views

How to get started with MATLAB? [on hold]

How to get started with MATLAB specially for Numerical Analysis and Computational Fluid Dynamics?
2
votes
0answers
32 views

Semidefinite Programming Using CVX in Matlab

I have the following optimization problem $$\begin{align} &\min_{ X_{1}, \dots,X_{k} } \max_{ \theta, \phi } \left|P_{d}(\theta,\phi) - \sum_{k=1}^K ...
0
votes
0answers
16 views

Fuzzy Logic in Matlab with missing values

In my data set for a particular observation there are data on 5 variables say A,B,C,D,E. I use Hamacher product by taking two variables at a time. That is I combine variables A and B and ...
0
votes
1answer
21 views

Convex optimization for symmetric (but not positive definite) problems?

Can one employ convex optimization for symmetric but not positive definite problems? I tried using MATLAB's quadprog() function to solve this problem: ...
0
votes
0answers
28 views

BiCopter simulation in Matlab

I derived a bicopter dynamical model with two servos and two BLDC motors. And now am trying to simulate it using Matlab. As base for simulation I used this paper and this code Unfortunately, the ...
0
votes
1answer
71 views

Reference request for matlab [on hold]

I am a complete beginner in computing and I am trying to learn some computing skills. I am learning how to use Matlab as my first programming language. Are there are websites that have notes for ...
1
vote
1answer
41 views

On the flight/matrix free SVD of large sparse matrix

I am trying to apply SVD to large sparse matrices. I already compared the performances of Propack and irlba to those of the matlab svd and svds. These two packages enhance significantly the computing ...
0
votes
1answer
56 views

bifurcation diagram MATLAB runs out of memory

I have a 3000 x 2301 matrix 'xfinfin' in MATLAB that I want to plot in the following way: ...
1
vote
0answers
84 views

Minimal surface finite differences problem - Matlab assemble

I face to the following problem: $$(1+u_x^2)u_{yy} - 2u_xu_yu_{xy} + (1+u_y^2)u_{xx}=0.$$ Problem needs to be discretized and assembled. Does anybody know how to proceed in Matlab?
0
votes
1answer
101 views

Why is Godunov's scheme (for the advection equation) diffusive?

I'm trying to solve the advection equation $$m_t+(\alpha m)_x=0$$ with $m(0,\cdot)=m_0$ numerically using the first order Godunov scheme. Hence I write ...
1
vote
1answer
77 views

Transfer Matrix Method in a rectangular potential well

I am trying to follow an algorithm that is described in Elementary Quantum Mechanics in 1D. I want to compute eigen-energies and functions in bound states in the basic case in rectangular potential ...
1
vote
1answer
84 views

Efficiently extracting a submatrix in Matlab

Suppose I have this matrix in Matlab R2013a M = kron(A,B); where A and B are $N \times N$ ...
4
votes
2answers
91 views

Under what circumstances can two (nearly) identical sparse matrices give different solutions to Mx = b?

Suppose I have two sparse matrices, $A$ and $B$, of size $N \times N$. They each have the same sparcity pattern ("footprint"). They each also have values which in theory should be identical, but ...
0
votes
0answers
20 views

“Tunneling” optimization algorithm in Matlab

I was wondering if someone has implemented the "Tunneling algorithm" for the global minimization of a single variable function in Matlab. I am hoping to implement it on $[B, A - \lambda I]$. Where ...
2
votes
1answer
44 views

Fast computation on 2D rectangular cartesian grid using matlab

I have a density function $f(x,y)$ on a rectangular domain $[0,1] \times [0,1]$ My domain is divided into cells of length $[0,h] \times [0,h]$, and I want to compute mass of each cell. I am going ...
0
votes
0answers
25 views

Matlab interface for minpack2

Is there a Matlab interface for minpack2? minpack2 http://ftp.mcs.anl.gov/pub/MINPACK-2 consists of Fortran programs , but i would like to call the test problems from matlab. What can i do ?
0
votes
0answers
39 views

Alter the output of ode45 before each and every iteration?

This is my integration function: function dy_dt=myode(t,y) dy_dt=(-2*y+3); This is my main script: ...
0
votes
0answers
42 views

Color Coding Gradient in Matlab

I am trying to visualize bond strength via a color gradient in matlab (such that a high energy would be in red, low in blue). The underlying data structure, bond locations, and bond energies are ...
2
votes
0answers
38 views

Numerically solving a system of partial integro-differential equations in Matlab

Given the following system of partial integro-differential equations $$ \frac{dX(t)}{dt}=\Lambda-\mu X(t)-\beta X(t)Z(t),\\ \frac{\partial Y(t,\omega)}{\partial t}+\frac{\partial Y(t,\omega)}{\partial ...
1
vote
0answers
29 views

fixed point iteration to find out second order non-linear diff equations

I am working on some model analysis, getting two diff equations and after I convert them into matrix form, I have equations looks like $$ [A][X]=C\times\big(\exp([B][X])-1\big), $$ where $C$ is a ...
0
votes
1answer
33 views

How to represent a binary number in a matrix in Matlab?

This is a fairly simple question but my Matlab knowledge is still very limited. I want to take a given binary number (or rather, a bistring) of length $mn$ and generate an $m \times n$ matrix whose ...
0
votes
1answer
31 views

Interpolation of Data Value using Optimized Weighting of Its Features

Assume I have a data set $ { \left\{ {x}_{i} \right\} }_{i = 1}^{N} $ which represents the value of each data point. For each data we have its features $ {f}_{i} \in {\mathbb{R}}^{d} $. The model I ...
1
vote
2answers
51 views

Arranging variable ranges into a cell MATLAB

I have the following simple code v=[]; for i=10:-1:1 for j=0:0.2:5 v(end+1)=i+j; end end min(v) It returns the minimum of vector $v$ whose length in this ...
3
votes
1answer
55 views

Is there an efficient $O(n^2)$ way to estimate in MATLAB a matrix condition number given its LDL decomposition?

Since evaluating a matrix condition number usually takes $O(n^3)$, I wonder whether there is an efficient $O(n^2)$ way to estimate in MATLAB a matrix condition number given its LDL decomposition. ...
2
votes
2answers
121 views

High computational time in using backslash for soving sparse matrix

I built a sparse matrix A at each step as follows: % 1 < DX < 120000 A = sparse(i,j,s,DX,DX,6*DX) b = (1, DX) The ...
3
votes
0answers
113 views

C60 orbital calculation

I am currently trying to reproduce the results published by Hands et al.1 using MATLAB. They calculated the bases of the C60 wave functions of HOMO, LUMO and LUMO+1. I did the following: I ...
7
votes
1answer
336 views

What is the numerical difference between abs(z)^2 and z x z*, where z is a complex number

I am doing research in electromagnetics (a branch of physics) and I deal with complex numbers in my computing tasks (I use MATLAB). Let's say $z$ is a complex number. To calculate the square of the ...
2
votes
2answers
94 views

SVD of large block-hankel matrix

I am trying to do SVD of a large block-hankel matrix for model order reduction (Low rank approximation). However, I quickly run into memory issues in forming the large Block-Hankel matrix and CPU ...
1
vote
0answers
44 views

1D fit on a surface in matlab

I have a problem fitting a $N\times N$ ($32\times 32$ in this case) matrix in Matlab. Here is the deal I have this image, and I want to create 1 dimensional fit between the points and then be able ...
1
vote
1answer
74 views

Multi-dimensional array reshaping Matlab

I have created a 4-dimensional array (cell) of arrays called "a" where a{i,j,k,l} = [ v_1 v_2 v_3 v_4] for some vector v. each of the index variables runs from 1 to 10 in steps of 1. I have a total ...
1
vote
1answer
67 views

Fast algorithms for computing only the generalized singular values (but not the vectors)

I am interested in computing only the generalized singular values, and was wondering if this was faster (and by how much?) than computing the full GSVD. In particular, I was wondering what the ...
0
votes
1answer
99 views

Curve Fitting problem MATLAB

I have a system of differential equations with some unknown parameters and I need to find the optimal parameter set that fits best with the data I have. For each parameter set choice (using for ...
-1
votes
1answer
210 views

How to initiate spirals in this model?

I am trying to reproduce Tang & Othmer paper which is related to excitations and oscillations in G-protein model in Dictyostelium discoideum, an amoeba species. The mathematical model in the paper ...
0
votes
0answers
19 views

Feedforward net lagged prediction [duplicate]

I am trying to predict y(t+1) of a function by using a feedforward neural network with Matlab. The inputs are the previous 3 previous values (y(t-2), y(t-1), y(t)) and the training output is the ...
3
votes
2answers
139 views

1D inhomogeneous Poisson PDE with Dirichlet BCs, slow convergence

For an assignment I have to implement a 1D Poisson PDE with inhomogeneous Dirichlet BC's $$\Delta_1 u = f, \quad u(a)=g(a), \: u(b) = g(b) $$ I have managed to make it work, but I am not seeing the ...
1
vote
0answers
39 views

Nonlinear 2D modeling of Neural Electromagnetic field in Matlab

I am trying to replicate the MATLAB simulation presented in this paper. More specifically, I have to code the solution to this equation $$\frac{a}{2R_i}\frac{\partial^2 V_m}{\partial x^2} - ...
0
votes
0answers
32 views

Matlab pde toolbox manipulate FEMesh object

Is there a possibility to write data to a FEMesh object? What I am looking for is an analogue to the MeshToPet method, something like a PetToMesh function. Any other way to manipulate the nodes in a ...
1
vote
0answers
57 views

Simple MCMC Algorithm in Matlab

I would be really glad to get some specific advise on how to implement a simple MCMC algorithm (in Matlab, if possible). I'm not yet too familiar with optimization methods. My problem goes as follows: ...
1
vote
2answers
126 views

How can I prove that two eigenvectors are orthogonal?

I obtained 6 eigenpairs of a matrix using eigs of Matlab. How can I demonstrate that these eigenvectors are orthogonal to each other? I am almost sure that I ...
-1
votes
1answer
65 views

Is iteration an efficient algorithm in this case? [closed]

My task in numerical analysis is We are interested in finding values of β0 for which z(x) = 2500. Use an efficient algorithm to determine the rays which pass through the receiver. Now I'm ...
1
vote
1answer
39 views

Assigning values to different regions in matlab

I am facing a problem as follows: I have created a Voronoi diagram and now I want to assign to each region, a value, i.e., I want to extend this Voronoi diagram to form a 2 variable function in ...
1
vote
0answers
84 views

Arpack and Matlab give different values for eigenvalues

I am solving a generalized eigenvalues problem with inversed complex shift: $$(M-\sigma J)^{-1}J \boldsymbol{x} = \boldsymbol{x} \nu \enspace .$$ My matrices are obtained from a finite element ...
1
vote
1answer
44 views

How to nest 2 simple CVX problems? Is it possible at all?

I have the underdetermined outer optimization problem $$\text{min}_{x\geq 0}\quad \|Ax-b_1\|_2^2+\|AT(x)-b_2\|_2^2$$ with $A\in\mathbb{R}^{m\times n}$ and $m<<n=64^2$ or in corresponding CVX ...
1
vote
1answer
61 views

Satisfying Periodic Boundary Conditions while plotting spherical particles inside a cube

I am trying to plot spherical particles in a cube of fixed dimension in matlab. I face a problem here where the center of the sphere is too close to the edge of the cube in this case the rest of the ...
0
votes
0answers
70 views

Integration in MATLAB: Complicated integrand

Can I solve the integral given below using Matlab? $$\frac{C(J)}{C_0} = \frac{2e^J}{\pi}\int\limits_{0}^{\infty} \frac{e^{\frac{\gamma}{2}\left[1 - \sqrt{\rho}\cos(\theta/2)\right]}}{a_1^2 + a_2^2} ...
1
vote
0answers
42 views

radially averaged power spectrum of a binary image does not look like power law

It has been known that Fourier power spectrum somehow obeys power law therefore the slope of the spectrum can be used to calculate the fractal dimension of an image. Many people have used it for ...
0
votes
1answer
120 views

Use line segments to approximate a function

I need to use line segments to approximate a function, f = 1/x. The range of x is from 1 to 2048 with an interval of 1. I will pick 10 locations for x and interpolate y between two adjacent x using ...
0
votes
0answers
120 views

MATLAB: code for restarted gmres

I have a question about Matlab and restarted gmres. I would like to use gmres.m provided here. This code seems to be a popular for the scientific computation ...