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
45 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
31 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
16 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
51 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
34 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 ...
0
votes
2answers
33 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
37 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
64 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
131 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
38 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
18 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
32 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
6
votes
0answers
53 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
15 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
33 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
45 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
19 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
38 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
35 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
18 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
1answer
39 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
0
votes
1answer
78 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 ...
0
votes
0answers
17 views

How to do the double integral of Gaussion copula in Matlab?

I have defined the expression of Gaussion copula in Matlab by two methods (see the introduce of Gaussion copula in the following two pages :1. How to compute the seconds-order partial derivatives of ...
3
votes
0answers
29 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
33 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
45 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 ...
4
votes
4answers
132 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 ...
0
votes
0answers
14 views

Deriving Matlab Algorithms for Linear Approximation (LU factorization)

This is Question 3 from here For part 2 I got the matrix L and U to be (using LU factorization): $L=\left[\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\ -1/2 & 1 & 0 & 0 & ...
1
vote
0answers
10 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
0answers
56 views

Solving Non Linear ODE with Dirichlet Boundary conditions in one Dimension

I have the following ODE problem that I need to solve for my project : $y''=\frac{1}{\epsilon^2}(y^3-y)$ on the interval $(0,1)$ with initial conditions : $y(0)=0$ and $y(1)=0$ . I am being asked to ...
0
votes
1answer
46 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
39 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
0answers
8 views

using wavelet transform for espisific frequencies

I want to analyze a signal in the time-frequency domain, at the frequency : 10,15 and 20 Hz, so should the input "scales" for matlab function 'cwt' be [.1 .15 .2], since the scale is the inverse of ...
0
votes
1answer
36 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 ...
0
votes
0answers
9 views

Find distortion exponent from Fourier fitting

I'm facing this problem in my master thesis: we are measuring the signal from a sensor which is, physically, a $\sin^2$ (or $\cos^2$). Some non idealities distort the signal by introducing an exponent ...
1
vote
1answer
51 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
36 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
43 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
39 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
38 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
37 views

Multi-complex arithmetic in MATLAB?

How can I go about performing multi-complex arithmetic in MATLAB?
0
votes
1answer
57 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
35 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
10 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
27 views

Nonlinear System of Equations in Matlab to create I-V curve for PV cell

I have four equations with four unknowns that need to be solved simultaneously to determine the four parameters needed in my I-V curve equation. ...
0
votes
0answers
64 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. ...
0
votes
0answers
15 views

Marking 2 data points on a plot

I have plotted a graph of solving a system of two ODEs using a Monte Carlo simulation. I have used a for loop and hold on to plot $M$ different solutions on 1 plot. I have found the expected values of ...
1
vote
1answer
103 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
20 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 ...
0
votes
0answers
35 views

How to plot phasors of signals?

I have 3 singals and I'm trying to plot their phasors and their sum. I need to plot them end to end to demonstrate phasor addition. That is, the first phasor must start from the origin. The second ...