MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks. MATLAB can be used when performing tasks such as signal processing and communications, image and video processing, computational finance, and computational ... ...

learn more… | top users | synonyms

1
vote
0answers
30 views

Cyclic Redundancy Check of an input sequence using MATLAB

I understand how to mathematically calculate the cyclic redundancy check CRC of bits, for example if the CRC is of length 16 $$ CRC(D) = (M(D) + I (D)) D^{16} \,\,\, mod \,\,\,\ G(D)$$ where $M(D)$ ...
0
votes
0answers
22 views

A maxdet problem with three variables - how to solve by hand or by Mathlab/Mata?

Problem Given $n$ known vectors $y_j = (y_1, y_2, ..., y_{K_j})', \forall j=1,n$ and a constant $K$; determine three vectors ($\alpha, \beta, \theta^2)$ that maximise: $$ \text{T} = ...
2
votes
0answers
23 views

What is a stochastic differential equation of the form $dZ = f(Z_{prev}, X_{prev})dt + CdW_t$ called?

At every time step I can approximate the change in $Z$ using the following equation: $$ dZ = f(Z_{prev}, X_{prev})dt + CdW_t, \quad(1)$$ $$dW_t = r\sqrt{dt}$$ where $C$ is some constant, and $r$ is ...
1
vote
2answers
34 views

Randomly choose any number of elements within a given sample randomly

If I want to arbitraraly choose any number $(1\sim9)$ of arbitrarily elements within $(1\sim9)$: Ex: 1. $n = 3$ (randomly) $\rightarrow$ choose $"1,4,9"$ (randomly & no repeat) 2. $n = 2$ ...
0
votes
1answer
108 views

updating of the cholesky decomposition

I try cholrank1 update (wikipedia) of the symmetric positive definite (SPD) matrix . ...
0
votes
1answer
29 views

Finding arctan with Euler

I am asked to find $y(t) = \arctan(t)$ using forward Euler method for $t=1,$ using initial condition. There is exact solution, but I need to approximate using methods such as Euler and Runge Kutta. ...
1
vote
0answers
33 views

How should I modify the initial guess for normalised version of an optimisation problem?

I am solving a large optimisation problem. The problem contains 500 decision variables and few hounderd constraints. Since the constraints are very tight and nonlinear, any random initial guess ...
0
votes
0answers
16 views

FFT differential equations

Given a generical differential equation what is the procedure to solve it using fft command. Can anyone explain me how to do it? For example: $$\frac{d^2y}{dt^2}+10\cdot \frac{d\:y}{dt}=-5\cdot ...
-1
votes
1answer
28 views

What is transpose multiplier and forward multiplier?

For linear system X = A*s, we define the forward and transpose multiplies Af and At as follows: Af = @(s) A*s; At = @(s) A'*s; I want to know what is forward ...
1
vote
0answers
53 views

Please help: My MATLAB code for solving a 2D Schrödinger equation keep giving me weird output.

I've been trying to solve the following Schrödinger equation numerically, \begin{equation} -(\frac{\partial^2}{\partial y^2} + \frac{\partial^2}{\partial z^2})\Psi + \frac{\sinh^2(y) + ...
1
vote
0answers
24 views

Matlab, Extracting Particular Values from an Excel File

If I have a table of values in Matlab ( here I have a 40k rows, and about a dozen columns), how can I read only particular values from each row? My goal is to extract some of the values from each row, ...
0
votes
1answer
28 views

Numerically solving equations with expectations

I have a equation $\mathbb{E}_\theta f(x,\theta)=a$, where $\theta$ is a vector real random variable with a known distribution, $a$ is a real constant, $x$ is a real (can be vector valued) variable. ...
2
votes
4answers
64 views

Inverse Chebyshev Recurrence

The Chebyshev polynomials (of the first kind) are a sequence of polynomials defined recursively by $$ \begin{cases} T_{0}(x) = 1 \\ T_{1}(x) = x \\ T_{n}(x) = 2xT_{n-1}(x) - T_{n-2}(x) \end{cases} $$ ...
0
votes
0answers
23 views

Solve first order BVP on MATLAB

I try to solve this equation on MATLAB $$y^\prime(x)=x+y^2(x)\quad\forall x\in(0,0.9),\quad y(0)=1, y(0.9)=32.725$$ I write two function on matlab, on myODE.m file, ...
0
votes
1answer
25 views

Matlab declare function with two different behaviours [closed]

I'm struggling in finding a way to declare a function with two different behaviours in the following way: $$f(x) = \begin{cases} \frac{\sin(x)}{x} & \text{if } x \neq 0, \\ 1 ...
1
vote
0answers
20 views

Two-sample Kolmogorov-Smirnov test for binary groups

I am using Kolmogorov-Smirnov test for selecting data that distinguishes two groups. I have defined the group with the binary variables (0 and 1). group = [1 0 1 1 1 0 0]; x =[2 3 4 5 2 -1 1]; I ...
0
votes
0answers
13 views

How to solve in matlab for B in this linear problem?

I have been trying to figure out how to solve the following linear problem: (S')(B)(S)=1 where S is a Nx3 matrix This is part of the procedure for estimating surface normals in Photometric stereo. I ...
0
votes
2answers
34 views

Integration of a function that is numerical solution of differential equation

I've obtained a numerical solution of a differential equation in a form of a vector (i.e., M(170,1)) by using ode45 (MATLAB) and ...
0
votes
2answers
37 views

Why does my answer depend on the starting values?

I'm trying to find the zeros of f(z)=c(z)-2500=0 using the secant method. I get the correct values (8.9, -2.6, 7.7, 12.3) but only if I put the starting values close. For instance this version of the ...
0
votes
1answer
40 views

Convolution in Matlab with different “sampling”

I am trying to figure out how to "normalize" the convolution that Matlab does (using the "conv" operator). If I have a rect function with spacing T and I do the convolution of that function with ...
0
votes
0answers
28 views

Fourier and MATLAB/simulink

I have been using pencil and paper to calculate the amplitude spectra of a unipolar square wave of amplitude 1v and frequency 2000Hz. I have used Fourier series to calculate the amplitudes of various ...
3
votes
1answer
100 views

Fun/Frustration With Coding Coding Theory

it's time for practical coding theory. I am trying to write a simple program that will detected if a given binary code word is "correct" or not. If it is not correct, I want to detect/correct (since ...
0
votes
0answers
11 views

A better way to visualize the change of output with respect to input of 3-dimentional data sets?

Background (1) I have a system $Ax=b$. Let us assume we do not know any information about $A$. (2) Both $x$ and $b$ are 3 dimensional data. In terms of physical meanings, both of them describes ...
0
votes
0answers
22 views

Computing nearest point in a cone of angle

Figure 1 In the above figure, there are 3 agents namely i_1, i_2 and i_3. For each agent, ...
0
votes
0answers
28 views

Optimization Toolbox (fmincon) - How to set logical constraints?

I'm pretty new to Optimization and barely understand it (was about ready to slit my wrist after figuring out how to write Objective Functions without any formal learning on the matter), and need a ...
0
votes
1answer
44 views

How can I remove correlated noise spikes from 2 signals?

I have some MRI data collected across time. When the patient moves, this results in a spike in the signal (so I guess it's not really "noise"). I would like to identify and remove these. So far I ...
0
votes
1answer
20 views

Estimate order of convergence given error table

I looked through some other posts and didn't quite understand what was going on... Given a numerical method of calculating the solution to, say, a DE, we typically get an error table. The errors are ...
0
votes
1answer
22 views

calculating z transform of vector matlab

Ive been reading the matlab guide of z-transform but cant find the solution. How do you calculate the z-transfom of : x[n] = [5,6,9,7,2];? ztrans([5,6,9,7,2],n,z); (in mupad) but this didnt give ...
1
vote
0answers
40 views

Chebyshev spectral derivation with 16 nodes for $\,f(x)=e^{\,\text{sin}^{2}\,(x)+\cos(x)}\,$ defined in $\,[0,2\,\pi].\,$

I'm making the following exercise in Matlab, and I'm having trouble expresing my result in $x\in[0,2\pi]$ not in $x\in[-1,1]$. I first done this (as shown below) in Gauss-Lobatto points, but I don't ...
0
votes
1answer
12 views

solving a stationary problem with matlab: descritization

The given equation is $$ \Delta(-\phi+\phi^3-\Delta\phi)=\frac{\partial \phi}{\partial t}. $$ I think it is equivalent to $\Delta\phi = \phi^3-\phi$ so I arrived to: $$ ...
2
votes
5answers
595 views

Does rotation of a rectangle keep it rectangular?

If I rotate a rectangle by 45°, does it stay rectangular or become something else? I mean do 90° angles stay 90°? I am asking this question because I have some results where the rotated rectangle ...
-1
votes
1answer
48 views

QR and Cholesky decomposition

A while ago I asked for help to develop a polynomial regression model using least squares, where the system was solved by cholesky decomposition, you can check it here Cholesky Polynomial Regression ...
0
votes
0answers
17 views

Correlation between ordinal variables

I want to know the correlations between 3 groups of variables which are oridinal (rating of 1 to 10). I have followed the formula on wiki and computed the Kendall tau-b correlation coefficients ...
0
votes
0answers
38 views

How to plot $\int\frac{\mathrm{d}y}{W(-e^{-y^2/2-1})+1}=x$ in Matlab?

I would like to plot in Matlab the following implicit equation: $$\int\frac{\mathrm{d}y}{W(-e^{-y^2/2-1})+1}=x,$$ where $W(\cdot)$ is the Lambert $W$ function. I am trying to plot it symbolically ...
0
votes
0answers
16 views

Inflow and outflow of Traffic graphs

For my bachelor thesis I am making a model for calculating a distribution of traffic in a network/graph given the delay on the links of the graph. I have written a Matlab program, and it seems to ...
0
votes
0answers
28 views

Solving 2nd order ODE with 2 independent parameters(over finite intervals), with bounds on solution

I have a 2nd order ODE of the form: $\ddot {x} + 2c \dot {x} + 39Ex = 0 $ $Initial$ conditions being: x(0) = 0 and $\dot {x}(0)$=0.1 Where c is in the interval [1,5] and E is in the interval ...
0
votes
0answers
13 views

Error estimation - spline interpolation

I got a question regarding error estimation and spline interpolation. I got a parabola shaped graph that I've used spline interpolation on to get more accurate data. I've used a much smaller step on ...
1
vote
0answers
48 views

How to calculate Gradient of a vectorized equation.

I am solving a huge optimization problem in Matlab. I am now required to obtain gradient of objective function,and nonlinear constraint along their hessien matrix. ...
1
vote
1answer
63 views

Cholesky algorithm

Good afternoon everyone, I'm in need of a factoring algorithm cholesky and algorithms to solve upper and lower triangular systems, but I'm not finding any work in that octave. Recalling that need the ...
2
votes
3answers
59 views

Least Squares method and Octave/Matlab [closed]

I'll try to be as clear as possible so that you understand what I'm trying to do and can help me I have twelve pairs of data $(x_1,y_1),....,(x_{12},y_{12})$ and from this data we established a model ...
0
votes
1answer
33 views

randomly rough surface by ifft : real output from ifft

I'm trying to generate a randomly rough isotropic surface with predefined roughness amplitudes (standard deviation of heights). Suppose I have the absolute values of fourier components of the surface ...
0
votes
0answers
8 views

Sorting signals to achieve highest possible similarty

I am currently trying to develop an algorithm in Matlab that sorts signals, which I have as columns of a matrix, to achieve the highest possible similarity of the signal with its neighbors. My first ...
0
votes
1answer
78 views

MATLAB: minimize function using x value from previous iteration

I'm trying to develop an algorithm for a proximal point method defined as: $$ \underset{x \in \rm I\!R^n}{\arg\min} f(x) + \lambda g(x) $$ where f(x) is a convex and coercive function and also ...
4
votes
2answers
190 views

Implementing Ornstein–Uhlenbeck in Matlab

I am reading this article on Wikipedia, where three sample paths of different OU-processes are plotted. I would like to do the same to learn how this works, but I face troubles implementing it in ...
2
votes
1answer
88 views

Evaluate integral over complex path numerically to show that $C_\infty$ is equivalent to $-I$

I would like to evaluate $$C_\infty = \int_{R = -a}^{R = a} H_0^{(1)}(z) e^{-izt} dz $$ where $H_0^{(1)}(z)$ is the Hankel function of the first kind, $a \rightarrow \infty$, and $$ z = R - i ...
1
vote
2answers
40 views

Secant method with two ODE's of degree 2 - matlab

$$\frac{d^2r}{dt^2}-r\left(\frac{d\phi}{dt}\right)^2=G\cos\alpha-g\frac{R^2}{r^2}$$ $$r\frac{d^2\phi}{dt^2}+2\frac{dr}{dt}\frac{d\phi}{dt}=G\sin\alpha$$ The two ODE's above are given. I have written ...
0
votes
2answers
54 views

please how to rotate a matrix $5\times4$ by 45° around the origin $(0,0)$? using matlab

Suppose I have a matrix $M$ of $5\times4$ dimension (this is represent an image) : M = [3 4 8 9; 1 6 7 3; 9 8 3 1; 1 2 2 0; 7 2 3 5]; ...
0
votes
0answers
24 views

Covariance from Gaussian Mixture Model versus direct calculation

I have a random variable $T$ which can be expressed as follows: $T=c_1P\cdot f+c_2Q$, here $\cdot$ denotes point-wise multiplication. $c_1,c_2$ are scalars and treated as constants. Distribution of ...
0
votes
0answers
38 views

Why do I get a big error when I compute this integral with Gauss-Legendre Quadrature?

I'm using Gauss-Legendre Quadrature to solve the following integral: $\int_0^{1}x^xdx$ After I've compared the result with the MatLab vpa(int(...)) of the same integral I've noticed that the ...
0
votes
2answers
50 views

Rational function regression without poles in a interval, or polynomial regression with positivity constraint

I have some sets of experimental data for some functions $f_i$ from $I=[0,1]$ onto itself, which should satisfy the following physical constraints: $f_i(0)=1$ $f_i(x) \in I= [0,1] \; \forall x \in I ...