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

0
votes
1answer
73 views

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

Given the following system of partial integro-differential equations - $\frac{dS(t)}{dt}=\Lambda-\mu S(t)-\beta S(t)F(t),\\ \frac{\partial I(t,\omega)}{\partial t}+\frac{\partial ...
0
votes
2answers
28 views

How to compute the incomplete Gamma function with an negetive parameter in MATLAB?

I need to compute the upper incomplete gamma function $$\Gamma(-0.5,0.5r)$$ But in MATLAB, the upper incomplete Gamma function "gammainc" is defined as $$\Gamma\left(\alpha ; x\right) = ...
0
votes
0answers
82 views

How can I resolve this improper integral?

I would like to resolve this integral numerically . However, I'm not sure about the best way to do it because it is an improper integral: $$ ...
0
votes
3answers
64 views
0
votes
0answers
23 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. ...
1
vote
1answer
37 views

Please help me in finding matlab code

How do I find the max value and the unknown variables of ...
1
vote
3answers
36 views

Solve for x with an expression of independent variable in the exponent

I am helping a friend in research. I wish to solve for x, in this equation. $p, k, m, l, r\text{ and }h$ are all constants. They may vary, depending on the user's input, but they would all be ...
0
votes
0answers
51 views

Matlab Coding finding zeros without using fzero or roots function

So i am a completely new at Matlab. I'm basically suppose to develop a function in Matlab that finds the zeros of a cubic polynomial. real and complex. I'm pasting below what I have so far. I started ...
2
votes
0answers
27 views

Understand and Implement adjoint operator of gradient

I have an equation as With initial ui=vi; yi=0, tau=1; I am implementing eq. 4.19 and 4.20 in MATLAB. Hence, I would like to ask you something. The adjoint operator of gradient is similar the ...
2
votes
0answers
34 views

eigenvectors of a unit lower triangular matrix

I know that for a lower triangular matrix, its eigenvalues are equal to its diagonal elements. And if we assume a unit lower triangular matrix, its eigenvalues are all equal to 1 (since it is a unit ...
0
votes
0answers
21 views

multiplication between a matrix and a givens rotation

I want to multiply a matrix A with a givens rotation G. As a reference to this very important link:Click here, they explained in pages 13 and 14 how this multiplication can be achieved. In this PDF, ...
0
votes
0answers
130 views

Second order coupled differential equations

I am trying to solve two coupled ordinary differential equation. $x''+Ax'+By'+Cx+Dy=U$ ; $y''+Ex'+Fy'+Gx+Hy=V$ ; $A,B,C,D,E,F,G$ & $H$ are constants, $U,V,x$ and $y$ are function of time. All ...
0
votes
1answer
51 views

How can I make graphs in matlab?

for my thesis I have to include figures. I want to make a figure as the figure in the attachment, but since I am pretty new to matlab I do not understand the best way (I know this may be a many ...
0
votes
0answers
20 views

Direction of rotation in matlab/simulink

I have a general question. In Simulink, say you have identified an axis for a revolute joint (x,y,z):(1,0,0) and you plot the angle. Is the normal convention the right hand rule? In this case positive ...
0
votes
2answers
20 views

Losing out on precision when importing values from notepad to Matlab

Here is the notepad file which I am trying to import to Matlab. ...
0
votes
0answers
37 views

How to solve complicated systems of equations with exponentials?

I'm trying to solve the system of equations at the bottom of this image, I need to solve for Rohm, Rdf, Rct, Cdl, Cdf, and Voc in terms of the theta parameters so I can calculate them from the ...
0
votes
0answers
17 views

Generating bernoulli variables for different lambda's

In order to generate $M$ paths of length $N$ I have to generate Bernoulli variables. In Matlab I used: Q=binornd(1,lambda,L,N); Now I want to generate this for a sequence of values lf lambda, but I ...
0
votes
0answers
10 views

How to build an 2-D polynomial from 1-D orthogonal polynomials

I have an set of orthogonal polynomials such as I want to build an 2D polynomial following the equation $$P_k(x,y)=P_k(x)P_k(y)$$ where $k=1..4, (x,y) \in [-1, 1]^2$ Based on given $P_n(x)$ as ...
1
vote
1answer
19 views

System of separable diff. eqns, explicit solution and curves, Lotka-Volterra model

In the book on p.68 is a system of differential equations for a Predator-Prey model (Lotka-Volterra) given as: $$ \dot x=x(\alpha-c\gamma) \\ \dot y=y(\gamma x -\delta) $$ On the next page, it is ...
1
vote
0answers
35 views

Revert problem in Kronecker tensor product

I have a question related to reverting kron tensor product. As We can see the in below example: ...
1
vote
1answer
27 views

More efficient algorithm for matrix rearrangement (MatLab)

Say I have the following matrix: $$A = \begin{bmatrix}0.1 & 2 \\ 0.1 & 4 \\ 0.1 & 6 \\ 0.2 & 3 \\ 0.2 & 2 \\ 0.2 & 7 \\ 0.3 & 10 \\ 0.3 & 7 \\ 0.3 & 5 ...
3
votes
1answer
44 views

Probability of True Positive of a random variable defined by an integral expression

$\newcommand{\Prob}{\operatorname{Prob}}$Let's assume that we have a random variable with the following pdf: \begin{equation} f_T(x) = \int_0^\infty f_T(x,g) \cdot f_{g}(g) \, dg = \int_0^\infty ...
2
votes
0answers
25 views

Distribution of $f(x,|h|)$, being $|h|$ rayleigh distributed

INTRODUCTION Let's supose we receive the following signal: \begin{equation} y[n] = hx[n]+W[n] \end{equation} where: $x[n] = Ae^{j2 \pi f_c t}$ is the transmitted signal $f_c$ is the carrier ...
2
votes
1answer
60 views

Classifying peak and valley *regions* of a histogram

I've been playing with a few ways of classifying contiguous regions of a histogram as: 1) peak, 2) valley, or 3) in-between bit. Global thresholding has worked minimally well for me so far, but I'm ...
0
votes
1answer
32 views

Rain forecast model and least squares

Good evening everyone, I'm trying to create a rain forecast model, I have about 720 data, which correspond to monthly rainfall in 60 years during the 12 months of the year. I have a matrix ...
1
vote
0answers
35 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
23 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
40 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
30 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
37 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
29 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
63 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
27 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
66 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
30 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
28 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
23 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
16 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
48 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
105 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
23 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
32 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 ...