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
0answers
14 views

How to show remaining time in timer clock matlab on pressing ESC? [migrated]

I have a program given i want to show the time remains when pressing ESC in stopwatch so anyone help me in this program i want to show the time remains after pausing stopwatch in dialog on pressing ...
1
vote
1answer
18 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
0answers
80 views

Origami - Flat-foldable / Calculation of angles

For several month now (2 months shame on me, but I won't give up), I try to code a method (7 pages) released in a publication related to conformal mapping (flow with circulation), origami and cones. ...
3
votes
1answer
42 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
19 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 ...
-4
votes
0answers
24 views

Matlab code for two variables [on hold]

I want to code this function in Matlab: $$ Y=5+e^{-2t}\sin(2x)+7x $$ So for my code is: ...
-1
votes
0answers
10 views

Matlab upper triangular matrix with identical column entries [on hold]

I want to create a matrix in matlab where the first column is one entry then zeros, second column is two of the same entries then zeros, third column is three of the same entries then zeros, etc. ...
-1
votes
0answers
15 views

How can I create in an orderly fashion, several matrices of varying size in Matlab? [on hold]

Say I have an nx3 matrix and I want to split it up into k different matrices based on the value of the 3rd column. (before running the program I don't know how many different values can be in the ...
2
votes
0answers
28 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
29 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 ...
-3
votes
0answers
49 views

Can you teach me how to solve this problem? [closed]

$\newcommand{\randn}{\operatorname{randn}}$ I am studying Linear Algebra by myself with '"Introduction to Linear Algebra, 4th Edition" written by Gilbert Strang. I am trying to solve all of the ...
1
vote
0answers
20 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
18 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
21 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
26 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
0answers
76 views
+50

updating of the cholesky decomposition

I try cholrank1 update (wikipedia) of the symmetric positive definite (SPD) matrix . ...
0
votes
0answers
13 views

Probability of a Random Sequence [closed]

So I was making this program in MATLAB for fault detection. I get a residual vector which I have to further test using Sequential Probability Ratio Test for which I should know the Probability ...
0
votes
1answer
27 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
30 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
14 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
27 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
34 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
21 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
26 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
58 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
20 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
0answers
15 views

The maximum descent algorithm

I am trying to implement the maximum descent(or optimized gradient) pseudo-code below $x^{(0)}\in\mathbb{R}^n$ initial approach for $x^*$ for $k=0,1,2,...$ $r^{(k)}=b-Ax^{(k)}$ ...
0
votes
1answer
23 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
16 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
33 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
27 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
24 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
88 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
10 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
19 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
23 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
30 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 ...
-1
votes
1answer
24 views

The meaning of w_hat = 1i*[0:N/2-1 0 -N/2+1:-1] .* v_hat; in Matlab [closed]

I'm studying a Matlab code for spectral derivation using Fourier techniques, and I don't know what the "1i*[0:N/2-1 0 -N/2+1:-1]" mean from the expression: w_hat = 1i*[0:N/2-1 0 -N/2+1:-1] .* ...
0
votes
1answer
15 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
18 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
37 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
11 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
2answers
56 views

Image restoration in matlab via PDE toolbox

I want to remove a noise for an image using matlab, when the observed image is $$f=u+v$$ where $u$ is the restored image (is the image i want recovered) and $v$ is the gaussian noise. To restore $u$, ...
2
votes
5answers
568 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
43 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
15 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
36 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 ...