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

2
votes
1answer
754 views

Implementation of EM algorithm for Gaussian Mixture Models using Matlab

Using the EM algorithm, I want to train a Gaussian Mixture model using four components on a given dataset. The set is three dimensional and contains 300 samples. The problem is that after about 6 ...
0
votes
0answers
12 views

Predict monthly event with pattern that repeats every year

General question: We look at "cost for maintenance" every month and it turns out that this is seasonal, e.g. in the summer this cost is significantly lower which can of course be explained due to the ...
0
votes
2answers
2k views

How to compute the upper incomplete gamma function in MATLAB?

I need to compute the upper incomplete gamma function $$\Gamma(0,i\pi K)$$ where $i=\sqrt{-1}$ and K is real. I have some basic idea about what this "special function" is, but am not used to using ...
-1
votes
1answer
14 views

Max value of a function in MATLAB

I am looking to find the max value of this function: log(x^(sqrt(2))) - x^3 + 4 I am having trouble with how to go about this problem. Any help is great. What I have right now is: y =@(x) ...
0
votes
1answer
26 views

MATLAB solve a single equation

I am trying to solve this equation: $e^x=x^e+e$ in MATLAB, but I continually get an error. I do not know where to go from here. Any help is appreciated This is what I have: a = x^exp(1) + exp(1) == ...
0
votes
0answers
9 views

Comparision of Axis-angle and Euler-Angles contradicting?

I used SpinCalcVis to compare axis-angle against the euler-angles and think the angle signs of both are contradicting. I used q = -1 0 0 0 as input. Using the ...
-1
votes
0answers
16 views

Matlab - calculate variance and expected value

I have a matlab question to solve some probability theory, expected value and variance. the code so far: ...
0
votes
1answer
21 views

implementing double $\sum_{m=1}^{p}\sum_{n=1}^{\infty }$ sum in MATLAB

I want to calculated following double sum: $$\sum_{m=1}^{p}\sum_{n=1}^{\infty }(-1)^{n-1}\Delta H.{erfc\frac{2(n-1)u+u\gamma}{2\gamma \sqrt{p-m}}+erfc\frac{2nu-u\gamma}{2\gamma \sqrt{p-m}} }$$ I have ...
2
votes
2answers
81 views

In MATLAB, $\pi$ value is given as 355/113. why?

$\pi$ is an irrational number. MATLAB shows it equal to 355/113 in fractional format. Is there no better fractional representation than 355/113 within the limits of the finite precision the ...
0
votes
0answers
4 views

Simulating AR(2) models with specific distributions

Say I want to create and simulate the $AR(2)$ model $X_t =1.5X_{t-1} - 0.5X_{t-2} + Z_t$, $Z_t∼WN(0,200)$ in matlab. To the best of my knowledge I define $model = arima('ARLags',1:2,'Constant',0)$ ...
0
votes
0answers
13 views

How write this function in Matlab? [on hold]

I got this constrained function and trying to use Matlab to solve it. $$ \frac 1 2 x^TXAXx: \lVert x \rVert^2=1,$$ where $A$ is a symmetric $n \times n$ matrix and $X$ is the diagonal matrix with ...
1
vote
0answers
11 views

How to build a matrix in MATLAB with the next characteristics?

Let $\lambda_1=\frac{k D_u}{2h^2}$ a constant value. How to generate a matrix in MATLAB with the next entries: $A= \begin{pmatrix} 1+\lambda_1 & -\lambda_1 & 0 & 0 & \cdots & 0 ...
0
votes
0answers
20 views

Problem with code for numerical integration in matlab.

Hi I have problem with calculating this expected utility with means of numerical integration, using matlab. The matrix stock data is a 1000x8 matrix with columns representing 7 stocks (columns 2-8, ...
0
votes
0answers
44 views

Rotating one 3d-vector to another only by using rotations about the coordinate axes.

If I have a vector v=(x,y,z) and would like to transform another vector u by using only rotations about the coordinate axes to be in the direction of v, how can I find required angles and the order of ...
1
vote
0answers
364 views

Produce a 4:2:2 sub sampled Y matrix, Cr matrix, Cb matrix for an image

I have write the matlab code below for to extract Y, Cb, Cr information from the picture: ...
0
votes
0answers
7 views

Matlab code - Lagrange Basis

The newxt code compute the interpolation polynomial by Lagrange's method evaluated in some vector $c$: ...
1
vote
0answers
7 views

Taking integration of a forward problem in a region of interest which is disretized-Microwave Imaging

I am trying to implemented the below formula in order to find the integration in matlab. However, I do not know how to do change of variables. The formula is ...
1
vote
1answer
704 views

Covariance matrix of two matrices- how to calculate

In maximum covariance analysis, to extract correlated columns, it is asked to calculate the covariance matrix. For two vectors, corvariance matrix is understood, COV(v1,v2) = v1*v2' How do I ...
-1
votes
0answers
9 views

How to save a variable in a function callback as application-defined data [on hold]

I am asked to write a matlab GUI program. The instruction tell me to save some variables in a function callback as application-defined data in order to use it in the other programs. What is ...
0
votes
0answers
12 views

How to call the function from CUTE library in MAtlab interface? [closed]

There are CUTEr/CUTEst Library for the test functions of unconstrained and constrained optimization problem. I need to call those functions in symbolic form in Matlab interface. Please help me in ...
1
vote
1answer
465 views

How to solve nonlinear constrained optimization in Matlab?

I have to solve a nonlinear constrained function in matlab, and I am not familiar with it's commands. the problem is: minimize $E(b,c)$ constraints: $k1< c\sqrt{b}< k2 ; c/6>k3$ Note: E(b,c) ...
-1
votes
0answers
17 views

help matlab exercise [closed]

I need help with matlab The math teacher is going to ask us to solve some exercises Matlab The teacher is very hard and explains nothing of Matlab in class We must learn to use the program on our ...
0
votes
1answer
432 views

Matlab integral with parameter

I'm a beginner with Matlab, and I'm trying to solve the following problem. I'd like to define a function $$F(x) = \int_0^{+\infty} \frac{\sin t}{1 + xt^4} \, dt$$ and plot it on the interval ...
0
votes
0answers
10 views

upsampling and plotting a signal in matlab

I want to upsample by 5 a signal in frequency domain, and then plot(stem) it. I figured how to upsample, Fk=(1/5)*upsample(ak_new,5) now this creates a vector ...
0
votes
0answers
15 views

Out-Of-Sample N-periods ahead forecast with MATLAB [closed]

I getting blind in front of my laptop trying to find out a way to code the following regression in a proper way. My data are a matrix $X=(ones(315,1), a \hspace{3mm}b \hspace{3mm} c \hspace{3mm} d)$ ...
1
vote
0answers
13 views

Implementation of Jacobi theta functions in Matlab

I need Jacobi theta functions for my Matlab program. The functions are not included in the predefined Matlab functions. Doing a simple Google search, I found a package developed by Moiseev I. in 2008. ...
-9
votes
0answers
47 views

help with matlab code [closed]

I am a student of an engineering career The math teacher sent us to solve some exercises Matlab The teacher is very hard and explains nothing of Matlab in class We must learn to use the program on ...
0
votes
0answers
19 views

Projectile with air drag using MATLAB

Unsure where to ask this question because it involves coding and mathematics. I am currently using the code ...
0
votes
1answer
36 views

definite integral in matlab?

I have just started learning how to solve definite integrals in matlab, and from the documentation, I picked up this example: $\int^{\infty}_{0}(e^{-x^2} )dx$ but when I run it in my matlab, I get ...
9
votes
2answers
3k views

Fast Matlab Code for hypergeometric function $_2F_1$

I am looking for a good numerical algorithm to evaluate the hypergeometric function $_2F_1$ in Matlab (hypergeom in Matlab is very slow). I looked across the ...
1
vote
1answer
519 views

MATLAB determining elementary matrices for LU decomposition

I am confused by this question I am studying for MATLAB practice.
0
votes
1answer
13 views

Numeric Currency Rate Prediction by using Genetic Programming. [closed]

I am start doing PHD and I like to work on Numeric Currency Rate Prediction by using Genetic Programming. Is everything done in this field or not if there what is it?. Thank you for help.
0
votes
0answers
13 views

Rosenbrock function matlab

I am new to MATLAB and I am asked to implement on matlab the following algorithm: for an unconstrained minimisation problem. I am asked to apply the BFGS method with armijo line search ...
3
votes
3answers
92 views

Solving Viscous Burgers using spectral method

I am trying to solve the Viscous Burgers equation using the spectral method. $$u_t+uu_x = Du_{xx}$$ where $D$ is a constant (chosen to be zero) and with the initial condition $$u(x,0) = ...
0
votes
0answers
14 views

Fitting with initial conditions

i try to do some fits but i have ten initials conditions and i think it will be difficult to evaluate the sensitivity of my conditions. Do you know some methods which allow to know the sensitivity of ...
0
votes
1answer
607 views

How to solve over-determined linear system of equations?

at the moment I am working on an application where I have to solve some systems of linear equations during the whole algorithm. Because the programming-language I have to use is something related to ...
3
votes
1answer
469 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
1answer
51 views

Finite Difference Method MATLAB Program

I am a beginner to MATLAB. I am trying to create a MATLAB program for the finite difference which is to calculate potential in a grid. I have to include a condition such that the iterations stop once ...
0
votes
1answer
1k views

Autocorrelation and spectral density in MATLAB

This question is twofold. We have an LTI system that is a first degree Butterworth LP filter with the power TF where fu = 110Hz and ...
1
vote
2answers
85 views

Numerical integration in Matlab (Simpson's rule)

A cubic polynomial is given by $$y=\frac{x^3}{6RL}$$ with $R$ and $L$ being constants. Use Matlab and numerical methods to find $x_l$ so that $$L=\int^{x_l}_0 \sqrt{1+(y')^2} dx$$ when $R=200$ and ...
0
votes
1answer
30 views

I dont know what is wrong ? MATLAB error in 'int' [closed]

I am new to MATLAB. I tried to use this command but it gives an error. Can you please point out what is wrong.? ...
-1
votes
0answers
12 views

Finding x in Ax=B using Householder and Givens Rotations

So I've written code to factor A into QR using Householder and Givens, but now I need to somehow find x, given A and b using them, and I'm confused at how I could find be using these QR factorizations ...
0
votes
0answers
14 views

Matlab: How to find a permutation matrices

I'm trying to figure out a way to compute the permutation matrices R and L given two matrices A and B. I would like to get L and R given that I know A and B. B=L* A* R. I wrote the code below for ...
0
votes
1answer
15 views

Cartesian to spherical coordinate :MATLAB program

I am a beginner to MATLAB. I have written this function, but don't understand what is wrong. I have used a if statement to correct the phi. Say if i use (x,y,z) = (0,-4,3) i should get (5,270,53.13) ...
0
votes
1answer
892 views

One strange way to generate b-spline base

I am trying to use curve fitting under Matlab. There are two kinds of spline in Matlab: piecewise polynomials and b-spline. For b-spline, we know that the basic functions can be derived by means of a ...
0
votes
2answers
819 views

Matlab coding help

I need to graph the following functions on MATLAB: $$x(t)=\frac{3sin(2t)}{2}\\ y(t)=\frac{-4e^{-1/2t} sin(\frac{\sqrt{15}}{2}t)}{√15}+2e^{-1t/2}cos⁡(\frac{\sqrt{15t}}{2})\\ h(t)=x(t)+y(t)$$ I have ...
0
votes
0answers
23 views

Matlab code for autocorrelation function for stock logreturn data.

I have one vector of T logreturn times and h lags between them. I want to estimate the autocorrelation by the function attached as well as plot the obtained values argsints the lags. How do I do this ...
0
votes
0answers
21 views

Interpolate solution derived with Matlab PDE tool

I have tried to solve a bvp problem using Matlab. Matlab succesfully returned the result of the numerical procedure based on an internal finite element method. However I don't know how to interpolate ...
-1
votes
2answers
228 views

Givens method for sparse matrix

I have to solve a linear equation system, Ax=b, where A is a (very) large sparse matrix (compressed sparse column form). From what I've read I think I'm supposed to use Givens method, but I don't ...