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

1
vote
0answers
87 views

Frequency of non-increasing and non-decreasing subsequences in Matlab

Having a sequence of numbers of length L, I need to count how many non-decreasing and non-increasing sub-sequences of exact length are there. For example, if I have a sequence of length 15 $$2, 4, ...
1
vote
1answer
107 views

$H_\infty$ norm of a transfer function by Matlab

Consider the simplest case: $$H(z) = \frac{z+1}{z+2}$$ I use two methods to find $H_\infty$-norm: ...
1
vote
1answer
97 views

Find local truncation error

We have the method $$ y^{n+1}=y^n+h \cdot [\rho \cdot f(t^n,y^n)+(1-\rho) \cdot f(t^{n+1},y^{n+1})] ,\quad n=0,\ldots,N-1 \\ y^0=y_0 $$ I have to calculate the local truncation error for the method ...
0
votes
1answer
68 views

how can I plot the infinite sum in matlab [closed]

I'm lookin for a way to plot $$\hat x= \sum_{n=-\infty}^\infty 0.5cos(1.3\pi n)sinc(t-n)$$ in matlab, and I can't find out how
0
votes
0answers
46 views

Singular value decomposition positive components

I am using Singular Value Decomposition (SVD) applied to Singular Spectrum Analysis (SSA) of a timeseries. ...
0
votes
1answer
46 views

How to find the $H_2$ norm of MIMO system in matlab

$K$ is given. $A,B_1, B_2, C_1, C_2, D$ are also given. I want to find the following: $P_{11}, P_{12}, P_{21}, P_{22}$ And use the resulte in 1., to find the $H_2$ norm of the system: ...
2
votes
3answers
149 views

Numerical estimates for the convergence order of trapezoidal-like Runge-Kutta methods

I have to calculate approximations of the solution with the method $$ y^{n+1}=y^n+h \cdot [\rho \cdot f(t^n,y^n)+(1-\rho) \cdot f(t^{n+1},y^{n+1})] ,\quad n=0,\ldots,N-1 \\ y^0=y_0 $$ for various ...
-1
votes
1answer
72 views

Represent mode of a probability distribution.

I am finding it difficult to represent a simple analysis done in Matlab in equation form. The operation is of two step. Bin a data in 10 bins. (the distribution is unimodal) and then find the bin ...
1
vote
1answer
210 views

Examples for 1d finite element method

I am looking for some examples for my Finite Elements project (in one dimension). I have written code in MATLAB and would like to show a few examples of it working. I have one or two general examples ...
0
votes
1answer
39 views

Finding derivative using matlab

Suppose I can generate infinitely many values of x and f(x). The functional form of f(x) is now known. Now I need the value of f'(x) at each point. What is the best way to find it with satisfactory ...
0
votes
0answers
36 views

transfer matrices times a real-valued matrix in Matlab

I am a beginner in matlab. My question is: I want to do the following thing: where $A,B,C,D$ are all $3 \times 3$ matrices. So the transfer matrix should be a $3 \times 3$ matrix. $K$ is a $3 ...
0
votes
1answer
116 views

Solving $y' = 2xy^2$ using backward Euler

$$ y' = 2xy^2, \quad y(0) = 1$$ The formula for backward Euler is $$ y_{n + 1} = y_n + hf(x_{n+1}, y_{n+1}) $$ Where $h$ is the step size. Plugging in for $f$ $$ y_{n + 1} = y_n + h \times 2 ...
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 ...
1
vote
2answers
125 views

Approximating an integral using Monte Carlo Method

I wrote a solution for Calculate the value of the integral I = $\int_0^\pi sin^2(x)dx$ using the Monte Carlo Method (by generating $ 10^4 $ uniform random numbers within domain [0, π] × [0, ...
1
vote
1answer
121 views

Approximate an integral using Monte Carlo method

I have a question on an assignment Calculate the value of the integral I = $\int_0^\pi sin^2(x)dx$ using the Monte Carlo Method (by generating $ 10^4 $ uniform random numbers within domain [0, ...
3
votes
2answers
235 views

In a linear program, how to add a conditional bound to x?

I am working with a standard linear program: $$\text{min}\:\:f'x$$ $$s.t.\:\:Ax = b$$ $$x ≥ 0$$ Goal: I want to enforce all nonzero solutions $x_i\in$ x to be greater than or equal to a certain ...
2
votes
4answers
148 views

Find a function with certain requirements

I'm trying to find a function $y=f(x)$ that can be described as follows: $f(x) = g(x) + c/(x-x_a)$. With $f(x)$ I want to design a function with the following properties: $f(0) = 0$; $f(x)$ has a ...
2
votes
0answers
48 views

Reformulate this PDE in different notation

I would like to rewrite this general PDE \begin{equation} \alpha\partial_tu+\beta\partial_xu+\gamma\partial_{xx}u+\delta u=\varepsilon \end{equation} in this form $$c\left(x,t,u,\frac{\partial ...
0
votes
1answer
26 views

Plot my own function 'in two variables'

I have matlab function in two variables say $function_{something}(t)$ where $t$ is of size $2 \times k$, this is to allow to evaluate $k$ times in two values. So my output is then a $k \times 1$ ...
0
votes
1answer
709 views

How can you plot straight lines in Matlab using only values on x axis and the gradient of each line?

I'm trying to plot characteristics for the Burgers Equations. But I have to plot them only using the inbuilt function plot. It seems like a fairly straight forward problem but I still cant solve it
7
votes
0answers
183 views

fixed point iteration

I am trying to find the root of $f(x)=\arctan(x)$ by using successive iteration. There are some conditions to apply this in successive iteration . 1) The function has to be continuous. 2) ...
0
votes
1answer
69 views

How do I discretize a parabolic partial differential equation?

I have the following homework question: To keep my long sob story as short as possible, my awesome applied numerical methods teacher had a personal emergency and is replaced for the rest of the ...
0
votes
0answers
61 views

Matrix into a 4-tensor

I've been trying to figure out a way to add a dimension to a matrix with a certain rule: Let our matrix X have dimensions NxM, L be some positive number, and the desired resulting 4-tensor (3d ...
0
votes
0answers
108 views

How to use CVX to solve this problem?

I have a function in the variables $x_{kl};\ k,l=1\ldots,m$, $$\sum_{i=1}^n \sum_{j=1,j<j'}^{N_i}\left( b_{ij} b_{ij'}- \sum_{k,l=1}^{m}x_{kl}f_k(a_{ij})f_l(a_{ij'})\right)^2$$ where ...
1
vote
0answers
86 views

Plot the characteristics for Burgers equation

I'm trying to plot the characteristics for the following problem. So far I have managed to find all the gradients for the lines from each value of x0. But I'm not sure how to plot it. It seems like ...
4
votes
1answer
45 views

How can I set values going up by powers of $2$ in matlab [closed]

I am writing a code which will need values of $\sin(x)$ for $x = 2^2, 2^3, 2^4, \dots, 2^{25}$ Being fairly new at matlab still, I am unsure how to do this in the most efficient manner. I know ...
0
votes
1answer
45 views

Unexpected behavior with random numbers

I am trying to write a program dealing with random number generation, but I figured this would be the best forum to ask this. My program will, given each of the March Madness teams' probabilities of ...
2
votes
0answers
31 views

Finding feasible solution of inequalities in math software

I have a Math problem where I have some true statements, and I want to know if there is a feasible solution to an equation. I would like to know how to do that in either Matlab or Mathematica. The ...
1
vote
2answers
65 views

Name of this type of plot? Does anyone know how to produce it

Does this type of polar plot have a name? Does anyone know how to produce it in octave 3.8.1 which is compatible with matlab? Link to site
1
vote
1answer
1k views

Chi square goodness-of-fit test for Uniform distribution using Matlab

I need to test random numbers generators in 1, 2 and 3 dimensions. Criteria of test is that generated numbers are from uniform distribution. I am doing this using Matlab. I'm told to use Chi-2 test ...
3
votes
0answers
35 views

A guide on how to approach learning programming [closed]

I am going to take up an introductory course on computational mathematics this semester, in particular, to learn matlab. We are given lecture notes and problem sheets to work through, however I was ...
1
vote
0answers
42 views

Error in script for estimating $\pi$

I am new to matlab, and am trying to write a script for this equation for n=100: And am using this: ...
1
vote
1answer
558 views

matlab problem - removing frequencies after FFT, signal processing

I want to stress that this is not a coding problem, my problem is that i don't fully understand the mathematics surrounding the subject and that's why I believe I have a problem. I was given an ...
5
votes
4answers
256 views

Why can you not omit the '*' sign for multiplication in Sage, Matlab, and other mathematical software?

Question I have some experience with Sage and Matlab. Both mathematical software packages require you to have the '*' sign when multiplying symbolic variables with integers. For example, in Matlab ...
1
vote
0answers
14 views

How can we construct a matrix with size $n\times 2^n$ , i.e., each column vector is the vertex of the hyperplane generated by $[L,U]^n$?

In matlab, if we have two vectors L and U (with size n ), how can we efficiently construct a matrix with size $n\times 2^n$ , each column vector is the vertex of the hyperplane generated by $[L,U]^n$ ...
0
votes
1answer
228 views

What does linearization do in MATLAB's PID tuner?

I noticed that the PID tuner from MATLAB has a linearizatin step before tuning. What does this linearization step do? And why we have to linearize a model in PID tuning?
1
vote
0answers
211 views

How neural network in Matlab gives such a nice prediction while having just one input neuron?

Here is the script generated by ntstool. I removed commentaries and set feedbackDelays(number of input neurons) and ...
0
votes
1answer
298 views

How to get rid of linearly dependent columns of a given matrix on matlab

I'm having a hard time in trying to get rid of linearly dependent columns of a matrix on matlab. I was trying to run this code ...
1
vote
1answer
126 views

Is my matlab code solving the problem?

I'm solving an assignment in numerical analysis where I use this model function for soundwaves under the water after fitting the model function in a least-squares sens and finding the coefficients. ...
0
votes
2answers
41 views

matlab matrix error when computing norm

Now I have $A =$ $$\begin{bmatrix}0.2 & 0.4\\ 0.21&0.39 \end{bmatrix}$$, and $b=$ $$\begin{bmatrix}0.6\\0.6\\ \end{bmatrix}$$ $\\$ When I solve $Ax=b$, I have the answer $x =$ ...
1
vote
0answers
63 views

Correcting the MATLAB code

I am currently trying to write a MATLAB code for solving The Sturm-Liouville system $$y''+ y=f(x) \quad \to (1)\\y(a)=\alpha\quad \to (2)\\y(b)=\beta\quad \to (3)$$ using Green's Function Method. We ...
0
votes
2answers
101 views

Remind me: How do we convert coordinates to space with different basis and origin?

I'm stuck with the very beginning of my homework. I might've even misunderstood the task. I'll try to translate the assignment in case I fail to explain what I need later: Task description: ...
0
votes
0answers
49 views

Length of a vector in 3 dimension spaces

while I'm studying principal-component analysis, I have misunderstanding about principal component, I was think that it's orthogonal and has a single point,which I mean by single points is if we have ...
1
vote
1answer
77 views

Multi-complex arithmetic in MATLAB?

How can I go about performing multi-complex arithmetic in MATLAB?
0
votes
1answer
374 views

Generating all possible edge permutations for a given number of nodes in a graph?

My problem is best explained using an example. Suppose we have a graph of $6$ vertices. I would like to generate all the possible edge combinations this graph would have, including the graph with zero ...
0
votes
0answers
47 views

What is meaning of $FFT(\vec{E}(x,y ))$

What is the meaning and how one takes fourier transformation of vector that has spatial distrubution. Let say electric field (with transfer x, y distibution) with direction $$FFT(\vec{E}(x,y ))$$ ...
0
votes
1answer
35 views

Grid Independence of Series approximation

I'm working on a project where I need to write out in MatLab an application of the Runge-Kutta formula to approximate the Bessel function. One part of the problem says ...
0
votes
0answers
211 views

Solve a equation involved differential operator in Matlab

I want to solve $F$ in the following equation in Matlab: $$ F + \partial_x F = Y, $$ where $F$ is a matrix (image), $\partial_x$ is the differential operator of $x$ axis, and $Y$ is a known matrix. ...
2
votes
1answer
444 views

Solve integral including Bessel function numerically in matlab

How can I write a code in matlab that solve this equation numerically, r & t are inputs and we can put every value.
1
vote
0answers
74 views

Symmetric Pivoting in LU decomposition

On the page of Mathworks I found a description of their pivoting strategy for symmetric matrices (http://de.mathworks.com/help/matlab/ref/lu.html): If A is a square matrix with a mostly symmetric ...