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

-3
votes
2answers
32 views

Matlab(Or Maple):How to assign values 1 to 100 to variables x1 to x100? [on hold]

I want to assign values 1 to 100 to variables x1 to x100,i.e. x1=1,x2=2,x3=3...x100=100. I tried using an array assignment for 5 variables by using: Array:=[x1,x2,x3,x4,x5]=[1,2,3,4,5] By running: ...
0
votes
0answers
12 views

Micro structure image to geometry [on hold]

How to create microstructure (2D voronoi diagram) from a microscopic image (tif) in MATLAB.
-1
votes
1answer
20 views

Making a basis from the Column Space of a Matrix in MatLab [on hold]

Starting with matrix A whose entries are all zeros or ones, I want to make a new matrix B whose columns form a basis for the column space of A. I know that rref puts A in Gauss Jordan form and the ...
0
votes
0answers
28 views

Distance/Similarity between matrices (different size) [closed]

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 ...
1
vote
2answers
88 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: ...
-1
votes
0answers
19 views

MATLAB code for membership functions [on hold]

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} ...
-1
votes
0answers
20 views

Opening MATLAB in Methmatica [closed]

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? [closed]

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 ... ...
0
votes
0answers
12 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 ...
2
votes
1answer
82 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
71 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 ...
1
vote
0answers
13 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
0answers
22 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
22 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
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 ...
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
37 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 ...
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 ...
-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
50 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
46 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
51 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
19 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
29 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
0answers
20 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
15 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
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? ...
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
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 ...
1
vote
0answers
37 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
43 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) ...
0
votes
0answers
22 views

Solving for 1 varible while missing two variables in non linear sin wave equation:

I can solve for y for the equation below but how do I go about solving for other freq(x) values? Example equation below: $$\left[ y={\it amp_1}\,\cos \left(2\,{\it freq_1}\,\pi\,t+ {\it ...
0
votes
0answers
16 views

Solving linear objective functions with linear and non linear constraints

Is it possible to use Matlab commands intlinprog and fmincon to solve a linear programming problem with a linear objective ...
0
votes
1answer
32 views

How can I find the value of y given x using matlab / octave

I have two points on a plot point1=(40,5) and point2=(50,1) How can I find the value of y given x=42.5 I know y is 4 by looking at the plot but is there away to calculate the y value directly. I ...
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 ...
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
35 views

Matlab, how do I change the default scatter plot size?

I am trying to do a approximation plot with Runge Kutta. In matlab, the discrete plot I use is "scatterplot". Unfortunately because of so many data points, the data points get mashed in and forms a ...
0
votes
0answers
13 views

creating smooth 2d plot with only a scaled colorvector and (x,y) coordinates | (matlab plotting issue)

I've an issue with visualizing the data in a correct way. I have an array with 3 colums and N rows. ...
0
votes
1answer
45 views

Plot given points\lines\arcs in 3D

I need to plot 6 points in 3D by using Matlab. I used the command 'plot3' but I couldn't draw it. The coordinates of points $A,A,B,B',C,C',D$ are given. $AD,BD,CD$ are straight line segments ...
1
vote
2answers
67 views

How to solve this equation numerically???

The equation is given by $$ \sum_{n=1}^N \min(\gamma, \beta a_n)=N$$ where $\beta$ is the variable with $\beta\in[0,\sqrt\gamma/\min(a_n\mid a_n>0)]$, $ \gamma $ is a constant with ...
0
votes
0answers
36 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:- ...
3
votes
1answer
48 views

Runge Kutta stability

I am facing a problem solving a ODE with a Runge-Kutta 4th order method: The expression in order to solve is : \begin{equation} Ay^{''}+By^{'}+Cy= Cu \end{equation} \begin{equation} y =OUTPUT ...
1
vote
1answer
31 views

How to calculate a posterior probability with a given Gaussian Mixture Model?

I'm building a GMM-based classifier in speech processing and I'm using GMM as a probabilistic scoring mechanism (therefore I don't intrinsically care about the underlying mixture components). For ...
1
vote
0answers
41 views

How to solve the matrix equation $A\overrightarrow{x}=\overrightarrow{b}$ in Matlab when nullitity$(A)\neq 0$

Say, $A= \begin{pmatrix} 1 & 0 &1 \\ 0 & 1 &1 \\ 0 &0 &0 \end{pmatrix}$ and $\overrightarrow{b}= \begin{pmatrix} 8 \\ -5 \\ 0 \end{pmatrix}$ and I want to solve ...
1
vote
1answer
29 views

Replacing pinv with inv in MATLAB

Let $\mathbf{y} = \mathbf{Ax}$ represent a system of equations where $A\in\mathbb{R}^{m\times m}, x\in\mathbb{R}^{m\times 1}$. However rank of $\mathbf{A}$ is $m-1$. I add another equation ...
0
votes
0answers
33 views

How to evaluate integral within an integral with symbolic limit in Matlab

I want to evaluate following integral which contains another integral inside. spol, which is a function of theta,is the lower limit of internal integral. The internal integral then will be multiplied ...
0
votes
1answer
19 views

matlab matrix substitution without loops

below there is a task we were asked to do using matlab. I wrote this function below which works fine. But, since 'for' loops were not shown yet in the course, I think that the instructor meant doing ...