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
0
votes
2 answers

Trying to write deconvolution function

I'm attempting to write my own deconvolution function in MATLAB, but am not sure my math is right. Can anyone assist? Attempting to determine x(n) given $$ h(n) = (1/2)^n , 0<= n <=4$$ and 0, elsewhere. Output sequence y(n) is {1, 2, 2.5, 3, 3, 3,…
samp1920
  • 139
0
votes
2 answers

How calculates Matlab the sqrt of a complex number?

i am just analysing a C Implementation of my Algorithm vs the Matlab-Algorithm. It works quite fine, exceptionally when it Comes to calculate the square root of a complex number. I tried already 3 different implementations on how to calculate a…
Roland
  • 49
0
votes
1 answer

Trying to write functions on Matlab

Im just learning matlab. I was wondering how can we make Matlab functions to perform $ABx$ is two ways: $(AB)x $ and $A(Bx)$ where $A,B$ are $n \times n$ matrices. I am stuck on trying to write these codes as I am not familiar with programming. Can…
user253161
0
votes
1 answer

Azimuth from Vincenty's inverse formula

I have been using the inverse solution of Vincenty's formulae (which I've implemented in Python) to calculate distance and azimuth between sets of coordinates. (The paper I've followed can be found here:…
BJH
  • 101
0
votes
1 answer

Matlab, how do I change the default scatter plot size?

I am trying to do a approximation plot with Runge Kutta. In matlab, the discrete plot I use is "scatterplot". Unfortunately because of so many data points, the data points get mashed in and forms a line almost. Also each data point is a giant empty…
Lemon
  • 12,664
0
votes
1 answer

Plot given points\lines\arcs in 3D

I need to plot 6 points in 3D by using Matlab. I used the command 'plot3' but I couldn't draw it. The coordinates of points $A,A,B,B',C,C',D$ are given. $AD,BD,CD$ are straight line segments $AA',BB',CC'$ are arcs with known radius $r$ and centers…
Harry
  • 271
0
votes
1 answer

matlab matrix substitution without loops

below there is a task we were asked to do using matlab. I wrote this function below which works fine. But, since 'for' loops were not shown yet in the course, I think that the instructor meant doing it without loops. Any ideas? Thanks! By the way,…
user135172
  • 1,053
0
votes
1 answer

Please help me in finding matlab code

How do I find the max value and the unknown variables of $$f=-\cos(\theta_A)\cos​(\theta_B)-​\sin(\theta_A)\sin(\theta_B)\sin(\phi_A)\sin(\phi_B)​-\cos(\phi_A​)\cos(\phi​_B)\sin(\theta_A)\sin(\theta_B​)$$ in matlab. Where $\theta_A, \theta_B,…
0
votes
2 answers

Losing out on precision when importing values from notepad to Matlab

Here is the notepad file which I am trying to import to Matlab. 0.0833333 -1.42876e-005 -6.8571e-024 0.166667 -2.86315e-005 3.59222e-023 0.25 -4.30324e-005 -3.44176e-023 0.333333 -5.7491e-005 7.89197e-023 0.416667 -7.2008e-005 2.58657e-022 0.5…
0
votes
1 answer

Finding arctan with Euler

I am asked to find $y(t) = \arctan(t)$ using forward Euler method for $t=1,$ using initial condition. There is exact solution, but I need to approximate using methods such as Euler and Runge Kutta. so $$y´ = 1 / (1 + x^2),\,y(0) = 0$$ but $y´$ is…
James
  • 3
0
votes
1 answer

Difference between impulse and step response.

My question is quite simple but I have some difficulties finding an answer to it. I was wondering what was the difference between the impulse and step response functions in MATLAB. The "help" section did not help me to understand the difference.
Dust009
  • 163
0
votes
1 answer

Solving an equation in matlab

I would like to solve the equation: 1/2*logninv(x, 0.03-1/2*0.2^2 + log(100), 0.2^2) +1/2*logninv(x, 0.03-1/2*0.1^2 + log(100), 0.1^2) == 100 I can solve this using excel with the solver, but I'm trying to solve it with matlab, I use the…
Holymonk
  • 191
0
votes
1 answer

Using the Monte Carlo method to find a volume

Use the Monte Carlo method to find the volume of intersection of, three cylinders, all of radius 3 units and infinite in length,with the axis of the first cylinder being the x-axis, the axis of the second cylinder being the y-axis and the axis of…
user237810
0
votes
1 answer

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 accuracy using matlab. In short it is described…
0
votes
2 answers

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 =$ $$\begin{bmatrix}1\\1\\ \end{bmatrix}$$. But when I type in…
user3124
  • 345