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
21 views

Failed attempts at fitting nonlinear Hill function (biochemistry) to data

I am trying to fit some data in Matlab to a Hill function of the form $y = \dfrac{1}{1+(K/r)^n}.$ I have data for $r,y$ and I need to find $K,n$. I have tried following the approach shown here in ...
0
votes
1answer
12 views

Matlab: function gradient and Hessian in the same function

Implement a Matlab function for computation of $ f(x),\nabla f(x),\nabla^2 f(x) $ The function must have the interface: function [f,df,d2f] = FunEx1(x) where $f(x)=f=x^2-2x+3xy+4y^3;$ I tried: ...
0
votes
1answer
14 views

Logspace() in Matlab [on hold]

In Matlab , Logspace() Generate logarithmically spaced vector . But what do we mean by them ? Earlier , I used to think that they are just equal spaced and their 10th power is returned . Like here : ...
1
vote
1answer
22 views

Accelerating linear solve in MATLAB for a specific type of matrices

Inside a DG solver (so far 1D) I need to solve a linear system of equations multiple times. The order of the system is rather small ($N=10..20$). I need to solve the system $Ax=b$, where $A$ is the ...
-1
votes
1answer
27 views

Solving linear equations in Matlab

I am trying to solve the problem $Ac = b$ but I am having difficulty figuring out how to set it up. I thought multiplying by ${\rm e}$ would remove the $\ln$ but I guess I forgot my basic math. My ...
0
votes
2answers
28 views

What does this matrix operation mean in MATLAB: X\y [closed]

I'm reading somebody's code and I'm trying to figure out what this line means X\y where X is a 100x2 matrix and y is a 100x1 vector
0
votes
0answers
5 views

isotropic volume from 3D dicom data

Iam working with CTA volume having dimensions 512*512*304. How I can convert the volume into isotropic form having axial size of 256*256.I have gone through ...
0
votes
0answers
13 views

Matlab code for determinism test by Kaplan and Glass. [closed]

The determinism test introduced by Kaplan and Glass Kaplan D T and Glass L 1992 Direct test for determinism in a time series Phys. Rev. Lett. 68 427–30. enables us to construct the vector ...
0
votes
0answers
29 views

Coding a bisection algorithm using matlab (numerical analysis)

To code the bisection algorithm. We assume that f at the two end-points a and b are of different signs. We will return the approximated solution when $b_{n}$ − $a_{n}$ < 2ε or when we have found ...
0
votes
1answer
27 views

Overflow an integer sequence at a given value

Sorry, the question seems to be extremely simple, but I fail to find an answer. I have an integer sequence 1, 2, 3, ... 8 I would like to convert it to ...
0
votes
0answers
12 views

Getting confidence interval from wblfitc matlab function

I am using the matlab function wblfitc which can be found here: http://www.mathworks.com/matlabcentral/fileexchange/38226-fit-distributions-to-censored-data It gives me an estimation for the ...
0
votes
0answers
8 views

Lax-Wendroff: Computing $\partial_{t}^{3}u$ given $u_{t}=a_{1}u_{xx}+a_{2}g(t)u_{x}^{2}$

I want to use the Lax-Wendroff method to $u_{t}=a_{1}u_{xx}+a_{2}g(t)u_{x}^{2}$, for g smooth function and $a_{i}$ constants. . That requires computing $u_{ttt}$ in terms of derivatives in x. Is ...
0
votes
0answers
15 views

solving byp system in matlab

I have problem to solve this in MATLAB. The equation already in first order system, yet I still confused to write the code and solve it. Or this equation cant be solved by using bvp4c perhaps? ...
0
votes
0answers
20 views

Solving Hyperbolic PDE using MATLAB (finite difference Method)

I am given the PDE $u_t + u_x = 0, x \in (-2,3), t > 0$ with initial condition $ u(x,0) = 1 - |x|$ when $|x| \leq 1$ and $u(x,0) = 0$ when $|x| \geq 1$. With boundary condition $u(-2,t) = 0$. How ...
0
votes
0answers
19 views

Finite difference scheme for piecewise domain heat equation

We have piecewise heat equation $u_{t}(x,t)=\left\{\begin{matrix} D_{1}u_{xx}(x,t) &x\in(0,1) \\ D_{2}u_{xx}(x,t) & x\in (1,2)\end{matrix}\right.$, with IC: $u(x,0)=2x+1$ and BC : ...
0
votes
0answers
19 views

Least n for which a family of vectors is linearly dependent

I want to code in MATLAB a function find the least integer $n$ for which a family of vectors are independent. $T$ is a linear operator, $v$ is a vector in $\mathcal{H}$. The family in question is ...
1
vote
2answers
58 views

Exponential Integral difference between Maple and Matlab

I try to calculate this exponential integral: $$\int_0^1 \exp(\exp(-s))ds.$$ I obtained different results in Maple: and Matlab: Which is correct?
0
votes
0answers
25 views

Approximating a Riccati Differential Equation/Differential equation of two variables

I am currently really struggling to solve/approximate this Riccati equation $x'(t, v) = cv(1-x(t)) + \beta x(t)(1-x(t)) - \gamma x(t)$ st. $0 < c, \gamma, x_{0} < 1$ $ 0 \leq v \leq 1$ $ 0 ...
0
votes
0answers
21 views

How to avoid NaN in this matlab computation?

I am given a bunch of log-likelihood ratios $\lambda\in(-\infty,+\infty)$. \begin{equation} \lambda = log\left(\frac{P(0)}{P(1)}\right) \end{equation} I can compute $P(0)$ and $P(1)$ from a given ...
-1
votes
1answer
24 views

How to approximate linear relationship between two timeseries? [closed]

I have two time series A and B I would like to solve for the equation in the form $$y_t = m x_t + b$$ that transforms a point $y$ at time $t$ from series $B$ to the corresponding point $x$ at time ...
0
votes
0answers
12 views

Matlab Mupad not returning ODE result

I am attempting to solve this equation (A ricatti ODE) in Mupad $x'(t) = cv(t)(1-x(t)) + \beta x(t)(1-x(t)) - \gamma x(t)$ ...
0
votes
0answers
10 views

Correlate normal shocks

I am trying to generate some random standard normal variables and correlate them In particular I want: $$ \bf Y \sim \mathcal N(0, \Sigma) $$ where $\textbf{Y} = (Y_1,\dots,Y_n)$ is the vector I ...
0
votes
1answer
23 views

Covariance matrix of a random vector

According to the documentation of Matlab regarding the function cov(): "if A is a vector of observations, then cov(A) = C is the ...
0
votes
0answers
11 views

For matlab. Is it true that by supplying analytical Jacobian and Hessian, the fsolve procedure would always converge?

For matlab, Is it true that for a system with unique solution, by supplying analytical Jacobian and Hessian, the fsolve procedure would always converge? I also wonder if supply analytical ...
0
votes
1answer
25 views

problem in solving system of equations in Matlab

please help me to find the problem. I ran the below code syms u v S = solve([2*u + v == 0, u - v == 1], [u, v]) and got the below error ...
0
votes
1answer
25 views

problem with solving a set of equations using ODE solvers in matlab

I have used matlab ode solvers to solve equations of the form: $$dy/dt=f(y,t)$$ in other words, where for instance say with an explicit Euler time stepping $$y^{n+1}=y^{n}+\Delta t f(y^n,t)$$ Is it ...
-1
votes
0answers
21 views

How to estimate a mass-spring-damper parameters in MATLAB using RLS and OLS?

Assume that we have the differential equation of a mass-spring-damper model as follows: $$m\dfrac{d^2 y}{dt^2} + c \dfrac{dy}{dt} + ky(t) = F(t)$$ where m is the mass, k the spring's stiffness ...
0
votes
0answers
15 views

C /matlab/ Algorithm for monotonicity of Ploygon

is there any easy and understand able algorithm to check the monotonicity of random polygon and also help me to code in which language(c or matlab) is beneficial to code the algorithm
0
votes
1answer
11 views

decimal to binary conversion of recurring decimal numbers in matlab

I have made a function convert fractional part of a decimal number to binary, the code is given below: ...
0
votes
0answers
9 views

Inserting “holes” on a graph.

I am trying to plot the set $A = \big\{(x,y) \in \mathbb{R}^{2} \mid x^{2} + y^{2} < 2 \big\} - \big\{(0,\frac{1}{n}) \mid n=1,2,3 \dots \big\}$. I have tried different combinations of set ...
0
votes
0answers
24 views

Fourier Transform of 1/x

I am trying to calculate the Fourier Transform of $h(x)=1/x$ So I was thinking: Since the FT of $g(x)=sign(x)$ is $G(f)=1/(i\pi f)$ , then using property of duality gives that $G(x)=1/(i\pi x)$ ...
0
votes
2answers
51 views

Simple Monte-carlo approximation of $\pi$ and integration using Matlab.

Hi I am new to programming and the following task that my tutor want me to handle was a bit to hard to begin with. I hope someone can help me and I need the code in Matlab. You are throwing darts ...
0
votes
0answers
7 views

How do I validate my ARMAX model?

Say I have some ouput $y_1, y_2, \ldots, y_N$ and inputs $x_1, x_2, \ldots, x_N$ which, by various time series methods, I've found to match an ARMAX(2,2,1) model. So I've found the estimations for ...
0
votes
1answer
112 views

Normalized objective function in optimization problem

I have fairly standard linear optimization model with two objectives \begin{align*} \text{max}\, (f_1 &= 4x_1+5 x_2\,,\,f_2 = 1x_1 + 0x_2 ) \\ \text{subject to}& \\ 1x_1 + 1x_2 ...
0
votes
1answer
33 views

Constrained optimization with alternates in special conditions

I have the following optimization problem. $$\max_{a b} acx+bdy+z \ \ \ \ \ \ $$ subjected to $$ c = \begin{cases} 1, & \text{if } 2xa-yb-z\geq 4\\ 0, & \text{if} \ 2ax<yb+z\\ ...
0
votes
0answers
19 views

nonlinear optimization : restricting search space to “limited” preselected value

My function is nonlinear with respect to a scalar \alpha . However, the calculation of objective function is very time consuming, making optimization also very time consuming. Also, I have to do it ...
0
votes
2answers
43 views

Solve system of equations using matrices

Matrix of Unknowns: $X$ Known values (constants): $A, K, F$ How to solve using any programming language: $$ AX + XA^\top + K\cdot X = F $$ (${}\cdot{}$ is element wise product )
0
votes
0answers
13 views

Input a matrix with integral element in matlab

I am working on stochastic fractional differential equation , like below $$ D^2y+D^{\frac{3}{2}}y+y=1+t ,\space y(0)=0 ,y(1)=2$$I use RBF's (radial basis function) to solve it .so $y \sim \lambda_1 ...
0
votes
0answers
15 views

Why is the square of an image not equvalent to taking the autoconvolution of an image in fourier space?

Al right I know that in order to multiply in the normal domain I have to take the convolution in Fourier domain but when I do so in matlab and invert the result then I come up with nothing but a lot ...
2
votes
1answer
51 views

Real series convergence check

$$ \sum_{n=1}^\infty \frac{n! \> x^n}{(x+1)(2x+1) \cdots (nx+1)} $$ I start with d'Alembert, $\displaystyle L= \lim_{x\to\infty} \frac{a_{n+1}}{a_n}$ it gives me: $L=x+1$, to find convergence ...
0
votes
0answers
40 views

How can I raise a sum of imaginary numbers without losing it's shape?

I try to be be a little bit more specific; I define a Gauss sum with $$G(p,q)=\sum\limits_{m=1}^{q-1}\zeta_p^j*\zeta_q^m$$ Here $\zeta_q=e^{2\pi i/q}$ and $\zeta_p=e^{2\pi i/p}$ are qth and pth ...
1
vote
1answer
21 views

Plotting 2 parameters function in MATLAB

I want to plot 2 functions in MATLAB. First one is like this: X=[0.1 0.2 0.3]; Y=[5 4 1]; plot(X,Y); and the second one that I want to plot on the last function at the same figure is ...
0
votes
0answers
23 views

How to input equations in MATLAB and operate on them?

I'm using MATLAB R2013a. I want to input an equation in Matlab, e.g., $f(x) = x^2 - 2 x + 3$. I want it to be inputted by the user. I use the inline function for ...
0
votes
0answers
29 views

Numerical integration in Matlab using polar coordinates

I have a set of points givven in polar coordinates which suppose to lie on the perimeter of a circle. I would like to calculate the surface of the circle that is most close to the form the points ...
0
votes
0answers
31 views

Matlab FFT (dst) Diffusion equation with Fourier sine transform in Matlab

Good day, following the exposition presented on this site PDE with Fourier Transform I'm trying to solve a simple diffusion equation $u_t = u_{xx}$ with $u(x,0)=3\sin(2\pi x)$ and $u(0,t)=u(2,t)=0$. ...
0
votes
1answer
47 views

How to properly take derivative of discrete data numerically in matlab?

Taking derivative of discrete data requires some fitting and then using the b-form of the polynomial. How to make a 'good' fit and properly take derivative? I am confused what is the right behavior ...
0
votes
1answer
29 views

Use Matlab to determine the point of intersection of lines

I want to determine the point of intersection of two lines using Matlab. I have the two lines in the form of y = tan(theta)*x + c. I'm seeking an algorithm that does this and I already know how ...
1
vote
1answer
28 views

Factorize polynomial in Matlab

I want to factor (break up) a polynomial $P(x)$ into first orders $(x + a_i)$ for real roots and second orders $(x^2 + b_ix + c_i)$ for complex roots. That is to say, $$P(x) = \prod (x + a_i) \prod ...
0
votes
0answers
24 views

Implementation of the LOWESS-algorithim (local regression data smoothing)

I need to implement the LOWESS-algorithm in a piece of software I am working on. The LOWESS-algorithm is a type of filter, which applies a locally weighted regression on each data point. In this ...
0
votes
0answers
39 views

Inverse Laplace transform of complicated function

I have a Laplace transformed function that I'd like to transform back. It's quite a complex function however, which is why I am stuck: $$C(x,s) = ...