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
1 answer

What is wrong in the below codes which describes circles and lines in matlab?

I have drawn two lines. But , when I try to draw a circle on it, it doesn't work. a(1:400,1:400,1:3)=255; a(200,1:400)=0; a(1:400,200)=0; imshow(a); It works perfectly. But while I execute the below codes to draw a circle, the above lines vanish…
anurag
  • 3
0
votes
1 answer

How to convert rational numbers to irrational numbers in disp in Matlab

How can I convert rational numbers to irrational numbers in $\operatorname{disp}$ in Matlab? I wrote a method in Matlab to estimate the value using the Newton-Raphson Method but when I use $\operatorname{disp}$ to view the result it appears as [1/3…
user155971
  • 1,515
0
votes
1 answer

fourier transform in matlab

getting an error while trying to do fourier transform. my code: clc; clear all; close all; syms A1 B1 C1 D1 w; %% define t =…
-1
votes
2 answers

matlab cell convert to columns

I am having difficulty with MATLAB. I have 106 columns and 1 row. Each cell in each row contains a different amount of numbers. If I type result{1} I get 7. If I type result{2}, I get 3 numbers, etc... How can I list all the numbers out in the…
Jackson Hart
  • 1,600
-1
votes
2 answers

Use Matlab to print function values at 101 equally spaced points between [0.99,1.01]

Im very new at Matlab and I can't seem to figure out this seemingly simple task. I have 3 functions f(x), g(x), and h(x) which are technically the same but formatted differently. What I need to do is print out 101 equally spaced values between…
zack
  • 1
-1
votes
1 answer

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

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 and y values in those regions, I can fit the…
aneps
  • 263
-1
votes
1 answer

Using table() to show output

clc clearvars close all hVec = [2^(-1) 2^(-2) 2^(-4) 2^(-8) 2^(-16) 2^(-32) 2^(-64)]; %step size x1Vec = [1]; %x value y = @(x) exp(x); %main function dy = @(x) exp(x); %first derivative ddy = @(x) exp(x); %second derivative for i = 1:1 …
hirotaFan
  • 301
-1
votes
1 answer

How to implement subscript and superscript in legend (Matlab)

I am wondering how to implement text in a legend with both a superscript and a subscript, and with an horizontal bar, something like this: Image
-1
votes
1 answer

Find the smallest positive zero of the equation $ x = \tan x$.

Based on this question, Does it means I need to find the five smallest roots on the positive $x$ axis? What interval would these roots lie on?
-1
votes
1 answer

Plotting Series on Matlab

So I am trying to plot the following function: where: F1 = A*t; over the interval [0, pi] F2 = A*((2*pi)-t); over the interval [pi, 2pi] F3 = 0; over the interval [2pi, inf) I am not sure at all how to go about plotting this in matlab and have…
student
  • 89
-1
votes
1 answer

How to display theta properly for Matlab to plot graph?

y=cos(\theta); plot(y); axis([-pi pi -1 1]); I'm new to Matlab and am trying to display theta, this way doesn't work. How would I display theta in a trig function? I just created a simple version but I will need to apply it to a more complicated…
-1
votes
1 answer

Using variable index in matlab

If we have k=1:n, and then we put k in a function so we get fk=f(tk) for some values of tk, when I apply the program I get just fk for each value of k, it is not named by f1, f2. Here is the statements for…
-1
votes
1 answer

Different results for complex exponential (1-i)^500

I get different results for (1-i)^500 when solving it using an online complex numbers calculator and when solving it using MatLab. MatLab says it's supposed to be -1.809E75 with the imaginary part being zero. However, complex number calculation…
-1
votes
1 answer

How to download Matlab freely?

Is Matlab software freely available for downloadin?If yes, from which website, i can download it without much difficulty? I tried to download it fromhttps://in.mathworks.com But it is 30days free trial.
-1
votes
1 answer

Solving integral equation with an unknown function under the integral in matlab

Is it possible to solve a equations like this: $\sin(x) = (1 - \int y(x) dx) * y(x) $ whats matlab code for this equation?
1 2 3
22
23