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

Distance/Similarity between matrices (different size) [on hold]

I have many matrices that have different size. Specifically, those matrices have the same number of rows but vary in the number of column. Each row is a different signal measurements, and each column ...
2
votes
1answer
95 views

matrix with fractional exponent, not getting expected output in Matlab/Octave

I have a matrix exponential function that is called a number of times in an integration routine from the heat conduction model I'm trying to implement. It works, and my results match the samples in ...
0
votes
1answer
343 views

Gaussian distribution and its parameters

I need to learn more about Gaussian distribution and given a set of data, plot a Gaussian distribution of it. Using the following code sample, could you please tell me how I can plot a Gaussian ...
0
votes
1answer
52 views

Ordinary Least Squares (OLS) + Matlab

Please help me to solve the equation with Ordinary Least Squares (OLS) method. Given two same length vectors: $x=(x_{1} + ... + x_{n})$ $y=(y_{1} + ... + y_{n})$ 1) Find coefficients a,b,c for: ...
0
votes
0answers
14 views

MATLAB code for membership functions

I want to develop a membership function so that f(x) = \begin{cases} 0, & \text{if $x$ <=0.5} \\ (x-0.5)/1.5, & \text{if $0.5<=x<=1.5$ }\\ 1, & \text{if $x$ >=1.5} ...
0
votes
0answers
19 views

Opening MATLAB in Methmatica [on hold]

I've written the following program in MATLAB but now my MATLAB ine expired and I switched to Mathematica. Can someone plz help me to re-write this code in Mathematica? I'm kinda desparate. clear all ...
-2
votes
0answers
19 views

How do we solve an integral equation in matlab or octave? [on hold]

Example: $\int_0^1 \frac{\sin(xt)}{t} dt $ as $ x \to \infty $
0
votes
0answers
7 views

Fuzzy logic operators

This is the first time I am working with fuzzy logic. So I need some help.I have 5 input variables and for each of them I have created membership functions based on literature review. Now I want to ...
0
votes
0answers
6 views

How to find $B$ by solving the following linear system: $s_k$ $B$ ${s_k}^T$ $=1,$

How to find $B$ by solving the following linear system: $s_k$ $B$ ${s_k}^T$ $=1,$ $\qquad$ for $k=1 ... ,p$. Where $s_k$ is a $1\times3$ row_vector from the matrix $S= [s_1 ... ...
2
votes
1answer
2k views

Numerically solving a system of nonlinear ODEs with boundary conditions

I have a system of 6 second-order nonlinear ODEs involving 5 different functions of a variable $t$. Every function has a boundary condition at $0$. I've never taken a differential equations class and ...
1
vote
0answers
12 views

Given a point and figure, how can I find the distance?

I have this two formulas in Matlab: the_p=atan2((-y(2)+obs(2)),(-y(1)+obs(1))); phi_p=acos((y(3)-obs(3))/(norm(y-obs))); ... where y is a 3d point and obs is a ...
0
votes
1answer
494 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
0answers
10 views

Dashed Line in Legend - Mupad

I am creating a graph im mupad, with two lines - both black, but one is dashed (or dotted) while the other is smoooth. In the legend of this graph, how can I make it clear that these lines are ...
0
votes
1answer
796 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
1answer
324 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 ...
2
votes
1answer
76 views

Matlab questions about $a_{n+1} = 4a_{n} + n +1$

Solve the equation with Matlab Given: $a_{n+1} = 4a_{n} + n +1$ Start condition: $a_{i}=0$ Questions: a) Find x,y for: $b_{n} = a_{n}+xn+y$ such that: $b_{n+1}=4b_{n}$ b) Find an explicit ...
1
vote
1answer
70 views

Multiplication without exponents

Edited for clarity (The original statement of the problem I was explaining the problem as a redefinition of multiplication, as can see from the original comments; but I think the algorithmic ...
-2
votes
0answers
10 views

matlab programme for differential equation solved using haar wavelet [closed]

Derive mat lab program for the equation: $$Y(x,t)=x + x^2 \sinh t.$$ Which is the exact solution of wave-like equation solvable by haar wavelet?
0
votes
1answer
373 views

Overlaying scatter points over world map in MATLAB

I am facing difficulty overlaying lightning location data over a region of the world map. I have lightning location data where the first column contains longitude and the second column latitude. I ...
2
votes
1answer
409 views

Roll PID Control for quadcopter

I'm trying to implement with simulink a PD controller for my quadcopter. I use a simplified model, and for the roll case I have $ I_x * \phi = L $, where L is the roll torque. So, the transfer ...
0
votes
0answers
21 views

Trying to model a substance settling in water using an advection equation?

I am trying to model a substance dispersed in a container of water gradually settling at the bottom. I am considering only one dimension. The top is at $z = 1$, and the bottom is at $z = 0$. So at $t ...
0
votes
0answers
21 views

Calculating the Span of a Matrix in MATLAB

If I have a matrix (or a set of vectors) say A=[1 2 4] [2 9 8] [7 9 3] how can I calculate its span in MATLAB? There is no direct command for it? Do I have to form a set of linear ...
0
votes
2answers
886 views

How to calculate the hessian of a matrix function

I am estimating a model minimizing the following objective function, $ M(\theta) = (Z'G(\theta))'W(Z'G(\theta))$ $Z$ is an $N \times L$ matrix of data, and $W$ is an $L\times L$ weight matrix, ...
0
votes
1answer
15 views

Azimuth from Vincenty's inverse formula

I have been using the inverse solution of Vincenty's formulae (which I've implemented in Python) to calculate distance and azimuth between sets of coordinates. (The paper I've followed can be found ...
0
votes
1answer
315 views

Matlab: Impulse response of linear time invariable (LTI) sine-signal

I'm preparing for a lab in a Signals and Systems course in my university, 5th semester. I've found old exercise material from the class and since I know some Matlab and have dealt with LTI systems ...
1
vote
1answer
22 views

Godunov scheme for advection equation

I'm trying to solve the advection equation $$m_t+(\alpha m)_x=0$$ with $m(0,\cdot)=m_0$ numerically using the first order Godunov scheme. Hence I write ...
0
votes
0answers
35 views

MatLab Proper Way to Use Trapz with Angles

I have a discrete function, say $B(\phi, θ)$, which is a $361 \times 181$ (rows for $\phi$, columns for $\theta$) matrix. In fact, this function has more than two dependent variables but I want to ...
4
votes
2answers
3k views

Solving $Ax=b$ under $L_1$ $|Ax-b|$ minimization

I would like to solve a linear system $Ax = b$ under the $L_1$ norm constraint $\min(|Ax-b|)$. All that I can find about $L_1$ minimization is a way to minimize $|x|_1$ subject to $Ax=b$. I wanted to ...
1
vote
1answer
45 views

Mass conservation for heat equation with Neumann conditions

I'm trying to implement Neumann boundary conditions to solve the heat equation with an explicit scheme. I checked mass conservation, but it doesn't seem to hold. Could someone check if my boundary ...
1
vote
1answer
391 views

Matlab: need help with optimization

I am trying to minimize the objective function over [x(1),x(2)]: exp(x(1))*(4*x(1)^2+2*x(2)^2+4*x(1)*x(2)+2*x(2)+1)+b subject to constraint ...
0
votes
0answers
35 views

How to solve a bi-quadratic equation with symbolic coefficients?

I have the following equation with the symbolic coefficients specified using syms which i have been trying to solve in MATLAB:- ...
2
votes
2answers
2k views

How I can get coefficients matrix in MATLAB from the set of linear equations?

I am working in MATLAB and having problem in extraction of coefficients out of my set of symbolic linear equations. Equations are as such ...
-5
votes
2answers
40 views

If-then-else function in MATLAB similar to Excel's function [closed]

The syntax for the "IF" statement in Excel is: IF( condition, [value_if_true], [value_if_false] ) Does MATLAB have a similar function for a one-liner if-then-else statement? For example, if $x>y$, ...
0
votes
1answer
46 views

Finding value of (y) of logarithmic equation given (x)

I have an logarithmic equation $$\left[ r=a\,e^{b\,\theta} \right] $$ And I plot it to visualise it (see plot below). I can tell by the plot when (t=0), x1=0, y=1 (point AA) but how can I find out ...
2
votes
2answers
45 views

Finding a perpendicular vector from a line to a point

Let's say I have an arbitrary linear line described by $y=mx+b$. I also have a point $P(x_1,y_1)$ that is not on that line. I suppose $P$ can be anywhere relative to the line. How can I find the ...
0
votes
1answer
46 views

Runge Kutta Method Matlab code

So I have a programming assignment with the following instructions: Consider the nth-order differential equation $$Ax^n (t) = x ^{(n-1)}(t) + x^{(n-2)}(t) + ... + x(t)$$ where $A$ is a ...
1
vote
0answers
8 views

Euler discretization for a trending Ornstein-Uhlenbeck process Matlab Code

I'm working on a matlab code for a trending OU process. I could easily find lot of material and reference for a stationary OU process and how to discretize it using a euler scheme like: ...
-2
votes
0answers
18 views

Estimating curvatures from smoothed spline in Matlab

I've been trying to work out the curvature of some lines based on a series of coordinates. I've been fitting spline curves to the points (parameterised by the nth coordinate) and working out the ...
0
votes
2answers
25 views

QR Decomposition results in eigen library differs from Matlab

I am posed with a problem whereby I am trying to decompose a rank deficient matrix into its Q-R components. This is the matrix we are interested in: ...
0
votes
3answers
45 views

Basic Mathematics (on MATLAB & Simulink)

I need some help for the below equation, is there any function which could help me to solve for b variable in MATLAB & Simulink? Otherwise, which numerical methods would you prefer? ...
0
votes
0answers
19 views

On Simulink, fzero function is an unsupported MATLAB function, is there any alternative?

I need to use "fzero" (or any alternative) function on Simulink, but MATLAB says: "Code generation does not support anonymous functions.". Is there any way to use this function on Simulink? I do not ...
0
votes
1answer
14 views

Fit a plane in data set which passes through maximum number of points in this data set and disregards noise

I have a set of 3D points (cartesian coordinates). I want to find the best fit plane. As I understand, there are many algorithms to get a best fit plane. One of them is this by Dan Couture. This fits ...
0
votes
0answers
40 views

How to find values of non linear equations / system and solve for given values

I'm trying to find the value for the variable phase in a equation / system if amp=0.5 and freq=2.5 (note: i'm looking for several different phase values given amp and freq but this is a small ...
3
votes
1answer
381 views

Plotting discrete time signals involving sumations in matlab.

Many of the examples I've encountered while looking for an answer are simple functions that do not involve summations. Suppose I have the following function; ...
4
votes
1answer
49 views

Principal component analysis (PCA) results in sinusoids, what is the underlying cause?

Background I'm analysing a data set of $M$ flow measurements (volume per time). The flows go from zero mL/s gradually to higher values and back to zero again, thus: their shapes ideally look like a ...
0
votes
1answer
42 views

Converting equation into Octave / Matlab code and a for loop

I have an array of thousands of values I've only included three groupings as an example below: (amp1=0.2; freq1=3; phase1=1; is an example of one grouping) ...
1
vote
0answers
30 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
1answer
345 views

MATLAB determining elementary matrices for LU decomposition

I am confused by this question I am studying for MATLAB practice.
1
vote
3answers
45 views

Finding when list of numbers reach periodicity given known values

I'm trying to figure out when numbers reach "periodicity" given known values. I've included an example below with image: I have known sizes (100, 75, and 50) that I would like to know how many times ...
1
vote
2answers
81 views

Finding where plots may cross with octave / matlab

I have several data points that are plotted below and I would like to find the frequency value when the amplitude value crosses 4. I've included an example note: this is an example and the amplitude ...