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

Optimizing buying and selling point for a stock

I am working on a problem and I need help getting started. Any pointers would be greatly appreciate it My problem: Given a $50,000 purse and 20/20 hindsight, and a particular stock, what are the best ...
0
votes
3answers
107 views

Calculate the number of times an angle must be repeated for it to complete a full rotation and for it to close

I'm trying to calculate the number of times an angle must be repeated to make a full rotation and become closed. Example: The internal angle of a pentagon is 108 degrees and it must repeat 5 times to ...
1
vote
1answer
76 views

M-matrix check in Matlab/Octave?

Is there a simple way to check that matrix is M-matrix in Octave/Matlab? Thanks, Vojta
1
vote
1answer
103 views

help to write the Mathematica or Maple code for $\log(1+x)$ as MeijerG

I am having difficulties working with some integral and I believe that if the natural logarithm in that integral is converted to its MeijerG equivalent, then it will be solved easily. can somebody ...
2
votes
0answers
117 views

Solution of an implicit Fourier transform equation

How does one solve the following equation ($\hat{a}(k)$ denotes the Fourier transform of $a(x)$ and $q$ is real positive): $$\hat{a}(k)=f(k)\widehat{a^q}(k).$$ This equation appeared in some paper. ...
0
votes
1answer
119 views

Matlab Math Help

Consider the curve traced by a point on the rim of a circle rolling along a straight line, a cycloid. If the cycloid were drawn in the xy-plane, then it could be described by the following position ...
0
votes
1answer
72 views

Matlab commands (with some prior working)

I am not too sure how to input the next two questions into Matlab. Would anyone know how to do this? Consider individuals for whom the Mosteller formula and the du Bois & du Bois formulae are ...
1
vote
1answer
2k views

Difference equations and Matlab (some working)

The difference equations below model the yearly populations of wolves and moose, measured in hundreds. The wolves kill the moose for food. http://imgur.com/jV3v06Y I think I've worked out what x and ...
0
votes
1answer
58 views

Help with Matlab commands?

The body's surface area is often using for determining doses of drugs. It's not easy to measure a person's surface area, so there have been various formulae proposed to estimate the surface area using ...
1
vote
3answers
3k views

Normalizing a Gaussian Distribution

Assuming a Gaussian distribution with mean of zero and standard deviation of one, I would like to normalize this for an arbitrary mean and standard deviation. I know you're supposed to add the mean ...
1
vote
1answer
549 views

reducing amplitude of fft spectrum with constant phase

I have a time series that I converted to the frequency domain using fft in matlab. I want to reduce the amplitude at a given frequency range (remove a peak between 1.5 and 2Hz) but keep the phase ...
0
votes
0answers
314 views

How to measure power spectral density in matlab?

I am trying to measure the PSD of a stochastic process in matlab, but I am not sure how to do it. If this is not the right place to ask, please point me in the right direction. The stochastic process ...
1
vote
1answer
193 views

How to proceed solving this problem?

I'm working on the problem "soundwaves under the water" (page 16 in the document is in English) from a numerical analysis book. I've got the following problem that is taken from the numerical ...
-1
votes
1answer
269 views

Plot using surf/mesh command in GNU octave

I want to plot a 3D plane in GNU Octave using the surf/mesh command. I have following data e.g a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17]; b= [ 0.001 ...
1
vote
1answer
289 views

How to run this matlab code? [closed]

I got code that I can't run that is said to produce the result: ...
0
votes
1answer
94 views

Pochhammer(x,n) for Negative x - Does any one know how to deal with this in Matlab etc?

I've tried to use a script that evaluates the Pochhammer symbol (rising factorial) in Matlab, but it fails to evaluate Pochhammer(x,n) whenever x is a negative number even though the expression is ...
3
votes
3answers
3k views

Kendall tau calculation

Can someone explain how the Kendall tau works? I can't seem to find a good explaination/tutorial/example. I've been running corr(x,y,'kendall') from Matlab's ...
0
votes
1answer
332 views

(theoretical) Negative Binomial Distribution using Matlab

I was trying to solve some exercises on Matlab in order to improve my skills and I stumbled upon this question: For the (theoretical) Negative Binomial distribution with parameters r = 5, p = 0.4, ...
2
votes
2answers
878 views

Which optimization algorithm converges faster?

everyone. I'm having a large scale unconstrained optimization problem. If I treat the unconstrained problem as a constrained problem with infinity constraints, I should be able to use both the ...
1
vote
0answers
88 views

How to generalize matrix multiplication?

Consider expression $x^T A x$, where $x$ is a vector of size $5 \times 1$ and $A$ is a matrix of size $5 \times 5$. The result of the expression will be a constant. Now, how to generalize this ...
0
votes
2answers
255 views

Shift interval of log-normally distributed latin hypercube samples

first of all I'm not sure if this part of StackExchange is the right one because my question is mainly on a way to implement something in MATLAB. Ok, now let me try to pack my whole question in one ...
1
vote
1answer
38 views

Help on symmetric integer sequence

I am programming a LRS binomial tree (Li, Ritchken, and Sankarasubramanian) and need to allocate some memory. Therefore at time step $i$ I need the following sequence: $i=0: (1)$ $i=1: (1,1)$ $i=2: ...
0
votes
1answer
3k views

Does matlab have a function which can calculate the intersections of two line in N dimension?

Does matlab have a function which can calculate the intersections of two line in N ($N\in R$)dimension? line 1 is as follows $w_1^Tx_2=c_1$, where $w_1,x_1 \in R^N$ line 2 is as follows ...
0
votes
1answer
56 views

matlab plotting

I have a problem matlab plotting, I have only one equation which is $$ H(\mu^2)= \mu^4 (D-D_{a})^2 + \mu^2(2D_{a}k- 2Dk+4\chi \rho h) + k^2 $$ Here $ D, D_{a}, \chi , \rho ,k, \rho $ are ...
1
vote
1answer
311 views

How to count the each number of row within a array in matlab

I have a matrix like- [1 2 3 3 3;1 2 2 5 5] From this matrix, I want to calculate in matlab that in each row how many numbers of 1 2 3 and 5? The result will be - 1 1 2; 1 2 2 I have tried with ...
2
votes
1answer
86 views

Partial vs. full eigendecomposition when computing matrix logs with Matlab

I'm looking over a program that performs a matrix logarithm in each iteration, which necessitates looking at the eigendecomposition of the given matrix iterate $M^{(i)}$. However, rather than consider ...
1
vote
0answers
77 views

Output of wavelet transforms

I am working on a time sensitive computer science and fluid dynamics project that requires me to find applications of wavelet analysis. I know that at its core, a wavelet transform simply takes a ...
0
votes
2answers
454 views

Programming discrete fourier coefficients in matlab

Alright so I am having the following issue: I want to figure out how to find the fourier coefficients of the following function: $$D(X)=\frac {a'(x)} {1+a'(x)^2}$$ Where $a(x)$ is an arbitrary ...
1
vote
1answer
95 views

SPECGRAM return value

I was studying this code: ...
1
vote
1answer
702 views

How to fit non-linear matlab data?

I'm working on a problem in scientific computing namely fitting data to this equation $c(z) = 4800 + p_1 + p_2 \cdot z/1000 + p_3 \cdot e^{ -p4 \cdot z/1000}$ The data is in a background question ...
1
vote
1answer
4k views

Why do I keep getting a vertcat error in MATLAB?

For some reason the following code gives me the following error: ...
0
votes
1answer
2k views

How do I get MATLAB to use custom labels for data in plots? [closed]

By this I mean, I have data that I would like to plot but each data corresponds to a different drug (aripiprazole, olanzapine, quetiapine and risperidone) and I would like the name of the drug to be ...
0
votes
1answer
82 views

Explanation for correlation coefficients and standard deviation rolling 3 dice

Roll in MATLAB 500 times threesome-dice (3 dice) and sum them.Find in addition: max and min in each sequence mean values of sum/min/max. deviations of sum/min/max. correlation ...
0
votes
2answers
1k views

What does log likelihood in dfittool in Matlab means?

I have a data set (400 real valued numbers between zero and one) which I need to fit an appropriate distribution to this data set. I used "dfittool" of Matlab and tried different distribution. For ...
-1
votes
1answer
170 views

Extract and then insert back a sub-block of a picture using matlab [closed]

I have a picture as an input to matlab $(256\times256)$: img=imread('cameraman.tif'); I want to embed a watermark using a spatial domain method. For this purpose i choose a random sub-block of ...
0
votes
1answer
70 views

Conditional Statements - MATLAB [closed]

I'm trying to write code that does something like this: In the time series when $v$ crossed zero from negative to posive, this was separated by at least $4$ days from other zero crossings (left and ...
-1
votes
1answer
266 views

How to get the y values between two x values on a plot-MATLAB [closed]

I have a plot (it is a spectra). I want to choose some peaks for fitting. How can I select a region from the Matlab plot? I want to choose some regions and do exponential fit. If I can extract the x ...
0
votes
0answers
44 views

Reflection lines generation with Matlab

Given a tensor-product surface in Matlab how can I generate reflection lines over this surface with Matlab? Thanks.
1
vote
3answers
296 views

PCA analysis on 1D set of observations

There are lots of discussions on the web about Principal Component Analysis (PCA) and how to use tools such as matlab octave for that. However none of them fit my problem. My problem is that I have ...
1
vote
1answer
1k views

Discrete Convolution

Does someone know the equation for the discrete convolution? I found here that the formula is: $$\{x*h\}[k]=\sum_{t=-\infty}^{+\infty}{x[t]\cdot h[k-t]}$$ But when using in Matlab/Octave the command ...
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 ...
3
votes
1answer
476 views

Pair Correlation with Uniformly Distributed Random Numbers

I am trying to reconstruct the following "jiggled" distribution from this article: American Scientist. The article states that the pair correlation function is defined as follows: "For each distance ...
0
votes
1answer
283 views

Fourier Transform for a Convolution

Alright, so I am using the Convolution property of Fourier Transforms to find a function $f(x)$. So the obvious equation: $h(x) = f(x) \ast g(x)$. Definitions: $$g(x)=Rect\left[\frac x w ...
3
votes
1answer
386 views

Switching from Mathematica to MATLAB: As a text editor?

I have been using Mathematica for almost a year, and the most indispensable feature in Mathematica to me has been the ability to write really nice documents and print them into PDF or TEX files. In ...
1
vote
0answers
515 views

Compute stationary distribution of a general markov chain

I have a stochastic matrix P that represents a markov chain. I know that the markov chain is irreducible and aperiodic and therefore, I know the existence of a unique normalised left eigenvector to ...
-2
votes
1answer
237 views

new to matlab please help me..

i don't know what site my question will fit but i saw a matlab tag so please consider my question.. today, we have an activity and no one finished it. so my professor decided to make the activity as ...
1
vote
2answers
250 views

Creating image in matlab with specified level sets of a complex polynomial.

I am trying to create an image in matlab which contains specified level sets for a complex polynomial. Suppose, for example, I wanted to create an image containing the sets ...
0
votes
1answer
37 views

Predicting time t given time t-n

..Hi, Everyone! I'm having a bit of trouble with a statistics/forecasting problem and I could use some help. I have temperature measurements for each hour of each day for the past 10 years. Given the ...
2
votes
1answer
208 views

Vectors Angles from $[0,2\pi]$

Given two vectors $V_1 = (x_1, y_1)$ and $V_2 = (x_2, y_2)$. How to calculate the angles between them in the range of $[0, 2\pi]$? I know the $\cos\theta$ similarity equation could present a $\theta$ ...
0
votes
1answer
330 views

Double dot product of two tensors [duplicate]

I have a problem that makes me very confused... I have two tensors that must be multiply. A is second order tensor and B is fourth order tensor. I know when multiplying two tensor with double dot ...