Questions about the numerical programming language MATLAB.

learn more… | top users | synonyms

0
votes
0answers
9 views

What is Precision-Recall Curve?

I have a data mining assignment where I make a content-based image retrieval system. I have 20 images of 5 animals. So in total 100 images. My code returns the 10 most relevant images to an input ...
1
vote
1answer
32 views

Is there a reference/source paper for the TUCKER_ALS() in Tensor Toolbox for MATLAB?

TUCKER_ALS computes the best rank-(R1,R2,..,Rn) approximation of tensor X, according to the specified dimensions. I am using MATLAB Tensor Toolbox Version 2.5. I am wondering if I write a paper, how ...
0
votes
2answers
104 views

Systems of nonlinear equations

Consider the nonlinear system of equations $$ (1) \quad qk^2a_1^2E^2+wna_0a_1AE+pnka_0^2a_1E+rn^2a_0^2A^2-rn^2a_0^3A^2+qk^2a_0a_1ABE-qk^2na_0^2E^2=0, $$ $$ (2) \quad ...
0
votes
0answers
32 views

Snell's law & polarization in MATLAB

Does anyone have a script that simulates Snell's law involving polarization?
1
vote
1answer
69 views

System of nonlinear equations in MATLAB

I've got some problems solving (numerically) this system of equations. \begin{array}{l} 40 \cdot \cos (2t) + 105 \cdot \cos ({\theta _3}) - 75 \cdot \cos ({\theta _4}) - 91.924 \cdot \cos ({337.62}) ...
0
votes
1answer
42 views

Initial estimate of coupled variables while applying implicit euler to solve nonlinear system of odes

I am trying to solve a system of coupled odes having the following three equations. $$ \begin{align} \frac{dn_A}{dt} & = e\left[j(t) - f\, θ_H\sinh\left(\frac{g\,n_A}{T}\right)\right] \\ ...
0
votes
1answer
56 views

Gilbert-Peierls algorithm for LU Decomposition

I searched for Gilbert-Peierls algorithm, but I haven't found anything useful (well, I found this, but it's not working as it should). I think the problem is the second part, and also that those ...
2
votes
2answers
109 views

Obtaining a 2D profile from a 3D surface

I am plotting a saturation field (as the solution of a finite element problem, using trisurf in MATLAB). Ideally, I would like to obtain the two-dimensional profile ...
2
votes
2answers
47 views

Extracting time scales information from empirical cumulative distribution function

I have a stochastic process (a Markov chain actually) that has two absorbing states. I am using a difference equation to calculate the first passage time to either of the absorbing states. There are ...
8
votes
3answers
189 views

Least squares approximation question

I am taking a course on scientific computation, and we just went over least squares approximation. My question is specifically about approximating using polynomials. I understand that if you have n+1 ...
1
vote
0answers
119 views

Givens method for sparse matrix

I have a (very) large sparse matrix in CSC form and I'm supposed to factorize it. I've read that between Givens and Householder transformations, Givens is better for a sparse matrix. The problem is ...
1
vote
3answers
100 views

calculate Binomial coefficient over $2^n$ in Matlab

I want to calculate ${n \choose k}/2^n$ for moderate $n$ and $k$. In Matlab, use nchoosek(n,k) with $n=60$ and $k=30$ will give a warning: "Warning: Result may not ...
0
votes
1answer
79 views

Matlab: Error in integral function

I want to compute an integral with the following code written in Matlab. ...
1
vote
0answers
112 views

Self-consistent numerical solution of a set of equations

I am trying to solve an assignment on solving the Bogoliubov de Gennes equations self-consistently in Matlab. BdG equations in 1-Dimension are as follows:- $$\left(\begin{array}{cc} ...
1
vote
1answer
102 views

How to plot probability density function in MATLAB?

I'm trying to get a frequency plot, or PDF (probability density function) plot for my biometrics project in MATLAB. I have two vectors genuine_scores and ...
0
votes
1answer
40 views

Custom CVX Functions - Overriding Errors [closed]

I have constructed a function in Matlab that is convex and increasing (qualitatively similar to an exponential function but I am hoping to avoid the successive approximation requirement of exp). In my ...
2
votes
0answers
35 views

Spatio-temopral wavelet analysis

Am quite new to wavelet analysis and would like some help. I am performing a spatio-temporal analysis of monthly gridded rainfall data. With PCA, I can reduce the dimension of the rainfall data into a ...
6
votes
2answers
198 views

Is there any numerical reason for not using repeated multiplication instead of integer powers?

I recently discovered that, in MATLAB 2013b at least, it is significantly faster to do repeated multiplication rather than integer powers. That is, ...
2
votes
2answers
101 views

visualization of 3D probability flow

I have a master equation for $P(N_A^+,N_B^+,N_C^+,t)$, with $N_A^+,N_B^+,N_C^+$ all discrete. The numerical integration is done by this Matlab program using Euler's method. Despite the crude Euler's ...
0
votes
0answers
27 views

Boundary layer in a stream function

i've to solve numerically this equation: where: psi_y=u psi_x=-v that is the boundary layer equation in a stream function. i want to solve this equation with a direct method. which are the ...
0
votes
0answers
51 views

Exchange the position of two particles using Matlab

need to exchange the position of two particles in order to test the symmetry of the wave-function $\psi(x_1,x_2)$ using Matlab. Can anyone tell me if there is a certain command I have to use? and if ...
2
votes
1answer
106 views

Solve Regularized Least Squares problems using Matlab optimization toolbox

I am trying to solve a least squares problem where the objective function has a least squares term along with L1 and L2 norm regularization. I am unable to find which matlab function provides the ...
3
votes
0answers
82 views

Transport Equation in a Tube: Source Term on Boundary

I'm modeling mass transport in a flow reactor. The flow reactor is a tube, which allows me to use cylindrical symmetry in solving the Convection-Diffusion-Reaction (CDR) Equation, which governs the ...
1
vote
1answer
131 views

How to solve the advection equation in 2 dimension using the Crank-Nicolson method?

I've an equation like this to solve with the crank-nicolson method where x and y are: [-2,5:2,5] and the time T is from 0 to 2*pi. Is there anyone who can help me? I have to solve it in a matlab ...
0
votes
1answer
68 views

A Filter is Sum normalized to 0 and square normalized to 1

Firstly, About the Hierarchical Model And X (HMAX model), i still don't understand what is the difference between the "Original model" and "Standard model". Does in Standard, we use imfilter not conv2 ...
1
vote
1answer
221 views

Particle Tracking Code - MATLAB vs. C++

First some background, I am a mathematician by training with very little formal training in programming. I am most comfortable in MATLAB and have been working with it for a long time. My second choice ...
0
votes
0answers
82 views

How can we visualize the data in polar coordinates using openDx?

Actually I am trying to visualize data in polar coordinates using openDx but openDx always does in Cartesian coordinates i-e in box shape I want circular shape of my data. I want the data ...
1
vote
0answers
41 views

how to find outward normal for robin codition [duplicate]

I wrote the code to fix this problem; now I should validate it using a test function to see the error in my code. I can't figure out how starting from u can derive the function g on the edge, in ...
0
votes
1answer
78 views

Matlab ttest does what exactly?

Matlab ttest "returns a test decision for the null hypothesis that the data in x comes from a normal distribution with mean equal to zero and unknown variance, using the one-sample t-test." Can ...
3
votes
1answer
85 views

Constrained System / Combinatorial Problem

Let $x\in \mathbb{R}^{n}$, $Y\in \mathbb{R}^{mxn}$. We can then define: $row_{i}(Y)=$ $i^{th}$ row of $Y$ $column_{i}(Y)=$ $i^{th}$ column of $Y$ $x_{i}=i^{th}$ element of $x$ $sum(x)=$ sum of ...
2
votes
1answer
172 views

Partial derivatives of a 3D array in Matlab

I'm interested in taking some partial derivatives of a 3 dimensional array in Matlab - say $A(i,j,k)$ approximates $f(x_i,y_j,z_k)$. I need to approximate things like $\partial_{xy}f$, ...
0
votes
1answer
176 views

Solving a system of linear congruences mod p, where p is not prime, and the system has 2+ variables

I'm working on some MATLAB code to perform something called the Index Calculus attack on a given cryptosystem (this involves calculating discrete log values), and I've gotten it all done except for ...
3
votes
0answers
135 views

assembly matrices in finite element method

I'm trying to construct the right–hand side of my 2D Poisson's equation in Matlab. I used the vertex rule in order to approximate the integral: ...
0
votes
1answer
120 views

Degradation Model in MATLAB

I am trying (using MATLAB) to generate the following image (from the section 4.1 Numerical Examples) of Wu Tian Chen research article 'Condition-based Maintenance Optimization Using Neural ...
2
votes
1answer
126 views

Sparse matrices that represent common stencil operations

I am not sure if this is the correct place to ask this question! Is there a data set such as the University of Florida Sparse Matrix Collection which is produced from stencil operations? Or is ...
4
votes
1answer
308 views

How to use Lanczos method to compute eigenvalues and eigenvectors

I have a sparse and symmetric matrix A(n x n). The method Lanczos tranforms matrix A into tridiagonal and symmetric matrix T and the Lanczos vectors in matrix V. From there how do I compute k ...
3
votes
2answers
262 views

Matlab preconditioned conjugate gradient on big matrix

I have a sparse $5\,656\,236 * 5\,656\,236$ matrix $A$ with $166\,526\,888$ non-zero elements. The matrix comes from using the finite element method on a linear elasticity problem and is positive ...
2
votes
2answers
135 views

Solving non-negative least squares in Matlab (by analogy with least squares)

There is a least-squares problem. It can be solved using backslash in Matlab. If Ax = b, then x = A \ b. Let's assume that I ...
1
vote
2answers
209 views

Polar axes in Octave?

if i draw a polar plot with Octave the axes are cartessian, not polar axes. But in Matlab it seems polar axes exists for polar plots. Is there anyway to draw with polar axes in polar plots in Octave? ...
2
votes
1answer
125 views

How Matlab optimization works without Jacobian or Hessian

How does Matlab optimization tools works? It just gets the error function and doesn't need Jacobian (first derivatives) or Hessian (second derivatives)? How it is possible? If it is finite difference ...
0
votes
1answer
83 views

Problem with while-end loop [closed]

This is a peice of code written in Matlab: while flag==1 flag = 0; disp('end of loop'); end Surprisingly, this does not display the string. If I remove ...
3
votes
3answers
456 views

Stuck on a hideous differential equation

I'm stuck on this PDE: $$\rho \cdot C \cdot \dfrac{\partial T}{\partial \tau} + u \cdot \rho \cdot C \cdot \dfrac{\partial T}{\partial r} = \dfrac{\lambda}{r^{2}} \cdot \dfrac{\partial}{\partial ...
4
votes
2answers
229 views

Big matrix multiplication on single machine

For example I have 2 matrices that can't fit in RAM. I need algorithm or library which can handle this.Preferably Matlab or Python. I think it can be some block matrix multiplication? Also I think ...
5
votes
1answer
707 views

How to add reaction and source terms to a diffusion PDE solver written with MATLAB's pdepe function?

I have the following system of equations which I'm trying to solve using Matlab's pdepe solver. The 1-D spherical heat diffusion equation with heat generation ...
0
votes
1answer
166 views

MATLAB quad function not work for constant function? [closed]

I want to use the quad function to do the integration today. I wrote a function file: function z=pdf_y1(x) z=100; And then, in the command line, I type: quad('pdf_y1',0,0.5) ...
0
votes
1answer
308 views

Implicit heat diffusion with kinetic reactions

I am using the implicit finite difference method to discretize the 1-D transient heat diffusion equation for solid spherical and cylindrical shapes: $$ \frac{1}{\alpha}\frac{\partial T}{\partial t} = ...
0
votes
0answers
52 views

MATLAB draggable 3D plot

I've plot a 3D double matrix in the figure. What i want to do now is to make the plot draggable, i.e. I can click on it and move it anywhere around. I've tried this function draggable but it give me ...
1
vote
1answer
1k views

How does Matlab's “interp2” compute bicubic interpolation?

Computational Science people: The title is the question: exactly how does Matlab's "interp2" command (with the "cubic" option) perform bicubic interpolation? I tried the Mathworks documentation ...
0
votes
0answers
168 views

Any note on Immersed boundary finite difference method?

For parts of a talk, I need a note on "Immersed boundary finite difference method", mainly about the reason of appearing this branch in the finite difference methods, considering mathematical ...
0
votes
1answer
47 views

Picking grain size or efficiently solving nonlinear equation via another way in MATLAB

I have an equation that says essentially, $$J = A_1 * ( \exp( -V * A_2 ) -1 ) + A_3$$ where the output $J$ is what is desired and depends on three constants and the output depends on $V$. My problem ...