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
2answers
1k views

How to do the following projection in Matlab?

I have 2 vectors $u$ and $v$ given in $\mathbb R^4$, e.g. $u = (-1,-2,3,4)$ and $v=(1,-2,-3,5)$ I also have $Ax=b$ which is an under-determined system; meaning, if $A$ is $m\times n$, then $m\le n$. ...
0
votes
2answers
80 views

What is the name of this data preparation?

I have a two-dimensional array ($569\times30$ double) which should be normalized using this formula: $x'_{ij} = \dfrac{x_{ij}}{10^h} $ What is the name of this normalization and how can I do that in ...
0
votes
1answer
181 views

How to do I this linear least- squares problem?

This is what i am given: $y=[3, 5, 5, 8, 10, 12, 15, 16, 18, 19]$ and $t=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]$ experimental data Solve x=A\b Thanks got it
2
votes
1answer
424 views

Automatic calculation of the intersection of discrete curves

first of all, let me apologize for a poor math-english translation, I'll try my very best. I have the following situation: I have over 16.000 data files which I generated from a biometric ...
2
votes
0answers
404 views

Understanding Fourier Transform and FFT

First off, I'm sorry if this is a repost. I am currently writing my thesis, and I've been thrown into some Fourier analysis, which I know nothing of. So, even if this question has been posted before, ...
0
votes
1answer
135 views

Changing Frequency of a Fourier Transformed signal

How can I change the frequency of a signal after taking its fourier transform? I am taking voice input from user in MATLAB and than I take its fourier transform to convert the signal in frequency ...
0
votes
0answers
73 views

How does one more Efficiently Numerically Solve Multidimensional Problems using Spectral Methods?

As per the title, would you please tell me how to more efficiently solve multidimensional partial differential equations? Other then just tediously writing out the matrix elements manually. If you ...
0
votes
1answer
35 views

Issues entering probability distrubution function in matlab

I want to enter this function into matlab, but I am in doubt what to do with the infinite spectrum My try was this, but the graph looks very wrong
1
vote
1answer
379 views

What does the error rate mean in Naive Bayes.

Can anyone explain what the Bayes error rate is in Naive Bayes, for instance in matlab: ...
0
votes
1answer
88 views

How to get PI based results in Octave?

In Octave octave.exe:4> asin(1/2) ans = 0.52360 is it possible to get the result in form of: ans = pi/6 It seems not ...
0
votes
1answer
975 views

QR decomposition with column pivoting, errror

I simply rewrote this algorithm http://faculty.nps.edu/borges/Teaching/MA3046/Matlab/qrlsdiary.html for QR ecomposition with columns pivoting to be applicable to a general matrix A (m, n). The ...
0
votes
0answers
437 views

Matlab, QR with columns pivoting

Is there any sample matlab code computing QR decomposition with columns pivoting for a matrix? I do not need an internal function, I would like to know the method... Thanks for your help...
1
vote
2answers
334 views

Matlab, operator A\B

What is the result of the operation A\B, where A(1, m) and B (1, m)? In the manual it is written: ...
0
votes
2answers
4k views

The mid-point rule as a function in matlab

How would I go about creating a function in matlab which would calculate the following $$M_c(f)=h \sum_{i=1}^N f(c_i)$$ where $h=\frac{b-a}{N}, \\c_i=a+0.5(2i-1)h,\\ i=1,\ldots,N$ What I have ...
2
votes
2answers
2k views

Runge-Kutta algorithm for a given ODE system

consider the system given by: $$x'_{1}=9x_{1}+24x_{2}+5\cos t-\dfrac{1}{3}\sin t$$ $$x'_{2}=-24x_{1}-51x_{2}-9\cos t+\dfrac{1}{3}\sin t$$ with initial values $$x_{1}(0)=\dfrac{4}{3}$$ and ...
1
vote
2answers
882 views

Moore-Penrose pseudo inverse algorithm implementation in Matlab

I am searching for a Matlab implementation of the Moore-Penrose algorithm (convertable to C++) computing pseudo-inverse matrix. I tried several algorithms, "Fast Computation of Moore-Penrose Inverse ...
-1
votes
2answers
946 views

How to define in Matlab the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$

I need to define the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$, how can I do this in Matlab? Thanks!
0
votes
1answer
521 views

Second Order ODE in MatLab

I am given an example file for solving a second order ODE using ODE 45 ...
0
votes
2answers
159 views

How to validate this Matlab code?

I am new to Matlab, help please. In the book I saw this picture for the following polynomial: $$g(t)=x_1+x_2t+x_3t^2+ \ldots +x_{10}t^9$$ for some $t$ and $g(t)$. The following code is given: ...
1
vote
1answer
251 views

compare 3 variables in MATLAB

I am wondering how to compare 3 variables in MATLAB, because MATLAB is comparing first 2 and then result against 3rd. To illustrate with example: (-1 == -1 == -1) ans = ...
3
votes
2answers
610 views

Reconstructing space curves from its curvature and torsion

I have to write a program which gets two functions (curvature and torsion) and 3 vectors of the Frenet-Serret "frame" at the starting point - and I have to reconstruct the space curve from this given ...
0
votes
1answer
10k views

How to use polyfit() function in Matlab?

First of all i am new to Matlab, and not sure whether to use polyfit or something else for my problem. I plotted a graph with the following matlab code: ...
3
votes
1answer
244 views

How does Matlab or computer algebra systems find derivatives of functions?

Is it correct that they use a matrix transformation?
1
vote
1answer
2k views

Graph Theory Shortest Path Problem via Matrix Operations in MatLab

Here is something that has been getting the best of me for past few days. Hopefully someone can point me get in the right direction. I have a graph G, and I need ...
1
vote
1answer
248 views

MATLAB LP formulation of investment problem (in Bertsimas' lecture notes)

I wish to write MATLAB codes to solve the following linear programming problem found in Bertsimas' lecture notes: My attempt was as follows (sequence of variables for f' is A, B, C, D, E, Cash1, ...
2
votes
1answer
530 views

Matlab Matrix Multiplication Calculate Significant Figures

First off, long time reader, first time poster. Thanks in advanced for all the help this site has offered! So the question! I have two matrices in the form of the variables ...
0
votes
0answers
254 views

Matlab: How to plot circular plot with mixed euclidean and polar coordinate parameters

How can I plot the following equations using Matlab?: $$x^2+y^2 = l_1^2+l_2^2+2l_1l_2cos\theta_2$$ and $$(x-l_1cos\theta_1)^2+(y-l_1sin\theta_1)^2=l_2^2$$ I'm guessing I have to fix $l_1$ and ...
0
votes
1answer
489 views

Matlab rotation matrix function not working correctly

I have made function in Matlab, that shale calculate the rotation matrix for fi degrees around unit vector k. ...
-2
votes
1answer
217 views

using Newton's method for three -dimensional system in matlab [closed]

Find the Jacobian matrix $J(x, y, z)$ for the functions $f(x, y, z) = x^2 + y^2 + z^2 − 9 = 0,$ $g(x, y, z) = xyz − 1 = 0,$ $h(x, y, z) = x + y − z^2 = 0.$ Then using Newton’s method for nonlinear ...
0
votes
1answer
402 views

How to graphs this gibbs fourier in matlab

How does one plot $y=|x|$ in MATLAB?
0
votes
1answer
193 views

Soundwaves under the water

I've got the following problem that is taken from the numerical analysis book by Kahaner-Moler-Nash (P8-15): The speed of sound in ocean water depends on pressure, temperature and salinity, all ...
2
votes
1answer
889 views

Approximate probability mass function into normal distribution

I have an array of values (mass function) Px and I want to approximate a normal distribution function (in Matlab) from them. I can plot the mass function using bar(Px) and I would like to plot normal ...
0
votes
1answer
857 views

How to compute the upper incomplete gamma function in MATLAB?

I need to compute the upper incomplete gamma function $$\Gamma(0,i\pi K)$$ where $i=\sqrt{-1}$ and K is real. I have some basic idea about what this "special function" is, but am not used to using ...
1
vote
3answers
446 views

Iterative solver for matrix division

I have two huge matrices $A$ and $B$. I am trying to find some iterative solvers like bcg or lsqr in Matlab. I mean if my ...
1
vote
0answers
158 views

how to correctly implement my own version of fft in matlab?

Currently I'm developing my own version of fft/ifft on matlab (homework) based on algorithm of Cooley/Tukey (radix 2). My code works fine for zero-padding images, but, how can I handle non-zero ...
3
votes
2answers
725 views

Time complexity of quadratic programming

I am using the Matlab built-in quadprog to solve a quadratic program with linear constraints. I vaguely recalled from school that the time complexity of quadratic programming should be $O(n^3)$, and I ...
0
votes
1answer
204 views

Need little help in making matlab code related with iteration methods

I have made following matlab code for computing the Moore-Penrose inverse of a given matrix A. ...
0
votes
1answer
550 views

Can we make such matlab code so that every time we run the program it will return the same randomly generated matrices?

I want to compare efficiency of two iteration methods for computing inverse of a matrices. I want to test performance of these methods on some randomly generated matrices. I want to know can we make ...
1
vote
5answers
1k views

How to multiply a vector of scalars with a vector of vectors in Matlab?

This sounds a bit strange, I'll explain it further. Assume we have a row vector $c = (c_1,c_2,\dots,c_n)$ and we have $n$ column vectors $v_i\in\mathbb R^4$ for $i\in\{1,\dots,n\}$. The $c$ is stored ...
0
votes
2answers
159 views

FDM for boundary value problem?

Given the problem \begin{align} &u''− x^2u(u − 1) = 0,\\ &u(1) = 2,\\ &u(3) = 4, \end{align} solve it with a finite difference method with the interval divided into $N+1$ equal intervals ...
2
votes
2answers
439 views

Binary Logistic Regression Model Processing

Thanks for showing interest and wanting to help out. My aim is to develop a model that - as accurately as possible - predicts how entities in a population will either cooperate or defect, as a % of ...
1
vote
1answer
1k views

What is the convergence order and asymptotic error constant for these results?

Define order of convergence and asymptotic error constant for a numerical method for equation solving. Two different methods have been used to solve the equations f(x)=0. Runs in Matlab give the ...
3
votes
0answers
345 views

How to avoid numerical overflow while computing a sum of products?

Suppose we have $N$ vectors $\vec{x}_1, \vec{x}_2,\dots,\vec{x}_N$. $\vec{x}_i$ is a $M$-dimensional vector: $\vec{x}_i = \left[ x_{i1}\;\; x_{i2}\;\; \dots \;\;x_{iM}\right]^T$ with all ...
0
votes
1answer
872 views

Can we generate random singular matrices with desired condition number using matlab?

Recently, I studied A research paper where author has compared his proposed method with several other existing method on a randomly sigular matrices with fixed condition number. My question is can ...
0
votes
1answer
331 views

Need help to compute running time

I have made following matlab code for computing cpu time of matlab inbuilt function pinv(A) to compute the Pseudo inverse of a given matrix. I had runed the matlab code 1000 times & calculated ...
1
vote
4answers
2k views

Generating a random singular matrices using matlab

Could anybody tell me that How one can generate a random singular matrices using matlab? I know that using rand(n) we can generate a random matrix of order n. But I found that these random matrices ...
1
vote
0answers
57 views

Is the partial derivative of K to A negative

I have a function $$Y_a= [\alpha_2(\alpha_1 ...
2
votes
1answer
570 views

Need matlab help related with the iteration method

I am reading an iteration method for computing the Moore- Penrose genralized inverse of a given matrix $A$, which is given as follows: $X_{k+1} = (1+\beta)X_{k} - \beta X_{k} A X_{k}$ where ...
5
votes
1answer
165 views

What is the difficulty when calculating this integral?

"What is the difficulty when calculating the integral $$\int_0^∞ \frac{6}{x^7+2x+1} dx $$ ? Solve the integral with matlab's quad." Sorry for my bad formatting, I'm just learning this formatting. ...
-1
votes
1answer
162 views

Displaying large matrices in matlab with pause when screen is filled?

Is there a function to display large array on command prompt with displaying only part of it and waiting until user enters something from keyboard.