Questions tagged [matlab]

For mathematical questions about MATLAB; questions purely about the language, syntax, or runtime errors would likely be better received on Stack Overflow. MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks.

MATLAB (Matrix Laboratory) 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 biology. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend its core capabilities.

In addition, MATLAB is a proprietary product of MathWorks. This means that, unlike other GNU GPL open source languages, both programmers and users must own a valid software license for running MATLAB code. There are several open source alternatives to MATLAB, in particular GNU Octave, which offers bidirectional syntactic compatibility with MATLAB, Scilab, SciPy, and Julia.

You could think about posting your question on Stack Overflow. They've got plenty of questions/answers already there.

Some informative links that show up quite often in answers:

User Amro has created a user-script for Matlab Syntax Highlighting for Stack Overflow. Use this link to install it.

3165 questions
2
votes
1 answer

Why is $\mathbf{realmax}$ equal to $\mathbf{(2-eps)*2^{1023}}$?

In Numerical Computing With Matlab it is stated that(Under the IEEE standard): "the smallest positive normalized floating-point number has f = 0 and e = −1022. The largest floating-point number has f a little less than 1 and e = 1023." We have…
bluesky11
  • 161
2
votes
1 answer

DNA sequence in MATLAB

I am wanting to count how many times synonymous and non- synonymous mutations appear in a sequence of DNA, given the number of synonymous and non- synonymous mutations in each 3 letter codon. ie given that AAA has 7 synonymous and 1 non- synonymous…
Aruman
  • 21
2
votes
1 answer

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 solution is based on Golub…
justik
  • 53
2
votes
2 answers

Drawing mesh figure in MATLAB

I want to draw a figure of the mesh which the interval (0,1) ared divided into 8 equalsize subintervals. Which comment do I need to use ? The points needs to be on the natural straiht line. Thanks
Brhn
  • 353
2
votes
0 answers

Computing large integers with matlab.

I want to compute the collatz sequence $(n,T(n),T^2(n),\dots)$ for $$n= 100\cdot \left \lfloor {\pi \cdot 10^{35}}\right \rfloor$$ with $$T(n) = \begin{cases} \frac{3n + 1}{2} & \text{ if $n$ odd} \\ \frac{n}{2} & \text{ if $n$ even} \end{cases} $$…
Adam
  • 3,679
2
votes
2 answers

Matlab Trapezoid Rule Code

Okay so I'm doing numerical integration using the trapezoid rule. I wrote the m file as such: function y = trap(f,a,b,N) h= (b-a)/N; y=0; for i=1: N-1 x=(a+i*h);y=y+eval(f); end y=2*y; x=a; y=y+eval(f); x=b; y=y+eval(f); y= (h/2)*y; …
blargh
  • 21
2
votes
0 answers

Help with the Steffensen's method in MATLAB not using Aitken's delta-squared process

I am new to MATLAB I have implemented the following code of the Steffensen's method but with out using the implementation of the Aitken's delta-squared process: %Test of Steffesen's Method function st(x0) tol=10^-6; % tolerance itmax=1000;…
user162343
  • 3,245
2
votes
1 answer

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 formula for $b_{n}$ c) Write recursive function with…
Eva Leon
  • 111
2
votes
0 answers

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: $$X_{n+1}=X_{n}+\theta(\mu−X_{n})\Delta t+\sigma \Delta…
2
votes
1 answer

Multi-complex arithmetic in MATLAB?

How can I go about performing multi-complex arithmetic in MATLAB?
user541686
  • 13,772
2
votes
0 answers

Quality of sinusoids in matlab plots

I am new to using MATLAB and used a plot to generate the graph for a simple sinusoid. The plot is that of a $50$Hz signal, $y=20\sin(100\pi t)$; it was plotted from $-1$ to $1$ sec the plot which I got was this I thought that the problem might be…
1
vote
0 answers

solving system of differential equation used in HIV modeling by matlab

I am really fearing with my project thesis and I need a desperate help..I am working on a HIV modeling and there are several's of non linear differential equations. I need them to be solved but I can't figure it out to solve it by matlab, the…
1
vote
1 answer

Matlab Gamma trasform question. One pixel transform.

How do I do this question? For a) I believe the value of $c=\frac{1}{255}$ but I'm not sure. Can anyone help?
George
  • 13
1
vote
1 answer

Working with piecewise answer in MATLAB

Sometimes MatLab gives me answer in piecewise notation, like this: piecewise([1 < x, 0], [abs(x) < 1, -(log(x - 1) - 1)*(x - 1)]) Is it possible to take any pair from answer? For example, take second pair from previous answer (will be -(log(x - 1)…
1
vote
0 answers

Localizing Region-Based Active Contours

I am working in Lankton paper Localizing Region-Based Active Contours that has to do with localized active contours and especially in mean separation energy part. I am stuck in a point that I cannot understand how this is implemented. The equation…
1 2
3
22 23