Tagged Questions

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

How to use matlab to a simple convolution problem (a convolution of the solution of the diffusion equation with continuous sources)?

I assume this is a simple problem, but since I don't have a strong maths background, I have trouble to implement this in matlab. Could anyone help me with it? Many thanks! The concentration of a ...
1
vote
0answers
19 views

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 question. I need theme to be solved but I ...
-2
votes
1answer
17 views

write a function that takes in a sentence and puts out the first letter in every word of that sentence matlab [on hold]

make a function in MATLAB that takes in a sentence and puts out the first letter in every word in that sentence i need to use textscan to break up the sentence and than put the first letters together ...
0
votes
1answer
30 views

Stuck on the code for this question! [on hold]

Write a function file to simulate N tosses of a fair coin (heads and tails equally likely). Your function should take as input the number N and output the number of heads. Use your function to plot (# ...
0
votes
1answer
23 views

Numerically solve integral with a function as variable of integration

I want to use a function as variable of integration for example in evaluating the integral: $\int_0^1 e^{\cos x}f(\sin x)d\cos x$ in which $f(x)$ is an arbitrary function.
0
votes
1answer
11 views

Finding the max distance between two arrays

I have the solution of an ode as an array $x(t_k)$ where $k=1,...K$. I have another array which is an approximation to the solution of the ...
0
votes
1answer
18 views

Plotting discrete time signals involving sumations in matlab.

Many of the examples I've encountered while looking for an answer are simple functions that do not involve summations. Suppose I have the following function; ...
0
votes
0answers
11 views

Matlab syntax for functions [on hold]

Following up on this question Matlab integral with parameter I'd like to understand the syntax surrounding this line of code from Robert Israel's answer. integrand = @(x) (@(t) sin(t) ./ (1+x .*t ...
0
votes
1answer
14 views

Matlab: Accessing parts of anonymous functions

If I define an 2 by 1 vector anonymous function in MATLAB: F=@(x,p)[a*x(1)*(1-x(1))-x(1)*x(2)-p*(1-exp(-q*x(1)));... -x(2)+b*x(1)*x(2)*exp(-x(2)/c)]; is there a ...
0
votes
1answer
31 views

Matlab integral with parameter

I'm a beginner with Matlab, and I'm trying to solve the following problem. I'd like to define a function $$F(x) = \int_0^{+\infty} \frac{\sin t}{1 + xt^4} \, dt$$ and plot it on the interval ...
0
votes
0answers
20 views

Matlab - Solving Differential Equation

I am trying to solve the differential equation numerically by using MATLAB, but I think it is hard... Let $f(t,z)$ be a complex-valued function. ($t$ is time, and $z$ is complex number) $f(0,z) = z$ ...
1
vote
1answer
19 views

State space system gives different bode plot then transfer function matrix

I have a discrete state space system with matrices $A$,$B$,$C$ and $D$ with sampling period $T_s$. I can either create a state space system, sys1 = ss(A,B,C,D,Ts), ...
0
votes
1answer
18 views

How do I solve $0 = x\times114 - x\times\log_3(x) - 20.28\times y$ in matlab for different values of $y$?

I have $y = 10^3, 10^6, 10^9, 10^{12}, 10^{15}, ...$ and above mentioned equation. How do I solve (i.e. getting values of x for different y) and plot this equation in MATLAB ?
0
votes
0answers
8 views

How to model and plot non-stationary mean-valued data

What would be the best way to plot a distribution of the data whose mean is non stationary. For example: if I have a data series, say y = [100, 97.3, 95.2, 93.2, 91.1, 91.2, ... 0] which yields ...
0
votes
1answer
23 views

How to isolate colour Green from the Picture.

The picture is: How do I isolate the green chips? The result must be in black and white. It doesn't have to be perfect. To isolate the blue ones I used: I=imread('Picture.png'); ...
1
vote
1answer
12 views

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?
1
vote
0answers
34 views

How to solve a discrete system of differential equations?

I am working with discrete ODE systems. I have a $(2x2)$ system approximation to the well-known predator prey model. In this $(2x2)$ approximation system, the right hand side of the system is given ...
0
votes
0answers
13 views

Finding a fixedpoint

How would I go ahead and find a suitable starting point to use in the fixedpoint algorithm? I've already made the algorithm in MATLAB but I don't know how to find a suitable starting point. Thanks!
0
votes
0answers
14 views

Gaussian Elimination Pseudocode to MATLAB script [closed]

So I'm having trouble understanding this pseudocode. It says that n is the size of the coefficient array, A(i,j) is the n-by-n coefficient array and l(i) is the index array l. I'm having trouble ...
-2
votes
0answers
19 views

What is the code for isolating yellow? Matlab [closed]

The result must be black and white. We should use thresholds and layers. I know that yellow is a combination of red and green. I(:,:,2) for green and I(:,:,1) for red.
0
votes
0answers
33 views

solve complicated system of non-linear equations numerically

I have two algebraic equations I am trying to solve in MAPLE. They are: $14\,{a}^{26}{b}^{2}-91\,{a}^{24}{b}^{4}-364\,{a}^{22}{b}^{6}-1001\,{a} ...
0
votes
0answers
11 views

Hudgin-Huxley model in Matlab by Euler Method [closed]

Can someone tell me as to why I am not getting the results though i think the code is correct logically. Thanks % Four First order differential equations for modelling an action % potential in ...
0
votes
1answer
20 views

Why does the denominator of TF change in MATLAB when multiplying by proportional gain?

Trying to simulate a unity feedback closed loop system with gain of $K$ Let's say I want a proportional gain of $K = 5$. My plant's TF is $G(s) = \frac{10}{s^2+2s+1}$. I thought that $KG(s) = ...
1
vote
0answers
13 views

Multiclass output in neural network

Please some one give a clear idea about my stack: In the previous question of some one (http://stackoverflow.com/questions/19593362/ann-multiple-vs-single-outputs) about the multiclass output case. I ...
0
votes
0answers
10 views

How to write the arguments $y_{pred}=argmax_iP(Y=i|x,W,b)$ in MATLAB

I am working a syntax on Neural Network for multiclass (1, 2, 3, and 4) with SOFTMAX activation function in output class. As we know the SOFTMAX lassification is done by projecting data points onto a ...
1
vote
0answers
9 views

Using MATLAB to solve a system of 2nd order non linear ODEs

I have 2 coupled non linear 2nd order ODEs which describe a particle's trajectory in space, subject to an initial horizontal and vertical velocity, and also to gravitational and aerodynamic forces. ...
0
votes
1answer
25 views

Given a data set of random values in MATLAB, how do I plot its PDF?

Suppose I have the following code in MATLAB: ...
0
votes
0answers
16 views

Implementing High Pass Filter in Simulink

I am trying to implement the following block diagram using Simulink in Matlab. I am having trouble getting the high pass filters to work properly. To do the filtering, I am using the First and ...
0
votes
2answers
26 views

Matlab: variable-dependent dot product in anonymous function

I have an anonymous function like this one: f = @(t) 5.*cos(t) + 10.*sin(t); f([1,2]) ans = 11.1162 7.0122 Is it possible to define f using a dot product ...
-1
votes
0answers
14 views

Invoking function with given coefficient in matlab

I have a $test.m$ with a function document $duff.m$ $test.m$ clc clear all [t,x]=ode23('duff',[0 100],[0 0]); y=size(x); plot(t,x); and $duff.m$ function ...
0
votes
0answers
29 views

Solving Duffing equation by Matlab ode23

How can I use Matlab to solve numerically this duffing equation with known $\kappa, \Gamma, \omega$..thanks.. $$x'' +\kappa x' +x -x^3 =\Gamma \cos\omega t$$ I have only few knowledge of Matlab..
1
vote
1answer
15 views

Some operation like determinant

we have determinant operation that is like below: $ det(\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \\ \end{bmatrix}) $= $ (-1)^{1+1}a(ei-fh)+ ...
1
vote
1answer
31 views

Analytical solution for bound state energies of infinite well

I am trying to find bound state energies assuming infinite potential. I have been told it can be done by analytically solving Right Hand Side and Left Hand Side of an equation such as: ...
2
votes
0answers
50 views

How to find nonnegative solutions of a linear system?

I have a $M$ equation and $N$ variables like this : $ \begin{bmatrix} 3 & 0 & 1 & 0 & -1 & -3 & 2\\ 1 & 2 & 0 & 4 & 0 & 0 & -1\\ 1 & 1 & 0 ...
0
votes
1answer
15 views

How to plot median with 10% and 90% percentiles

I have to make a plot of same data (I do it in Matlab). On the x-axis the time (in seconds) and on the y-axis the response time (in ms). Now I have to do it with "Median with 10% and 90% ...
2
votes
1answer
37 views

How to calculate a complex integral with branch cut?

I want to calculate this integral: $$\int_{-\infty}^{\infty} \frac{\exp\left(-i\sqrt{(\xi^2 - k^2)(y -y')} -i\xi(x - x')\right)}{-i\sqrt{\xi^2 - k^2}}d\xi$$ I can not calculate this integral, I can ...
0
votes
1answer
21 views

Simulating a controlled dynamical system

I am try to simulate a controlled dynamical system of the form $$\dot{x}=f(x,\phi(x)),$$ where $\phi$ is the controller. To do so, I am using Octave (an open source version of Matlab). My commands ...
0
votes
0answers
21 views

Matlab Code about evaluating Newton Polynomials

I am trying to write a code for evaluating a newton polynomial with coefficients $a = [a_0 , ... , a_n]$, and nodes $x = [x_0 , ... , x_n]$ at the vector $t$, using nested multiplication. ...
1
vote
0answers
20 views

how does the following parameters affect the peak ( radius ,theta) of the its frequency spectrum?

The following is the similar magnified picture to the second image that it indicates the parameter i am going to talk about. Suppose i am going to fourier transform (DFT) of the following picture ...
0
votes
1answer
39 views

How to plot fourier series in matlab

For homework (with no prior experience in matlab, guh.) I'm asked to do the following: Plot the (2N + 1)-term approximation $$\sum\limits_{k=-N}^N{a_ke^{jk\omega_0t}}$$ where $a_k = ...
1
vote
1answer
18 views

Why is matlab giving me a single answer when I divide by a vector?

I'm attempting to do a stem plot of $\frac{sin(k2D\pi)}{k\pi}$ in matlab. Following is my procedure: ...
2
votes
4answers
57 views

matlab get lower triangular matrix without loop and build in function

I tried to get the lower triangular n x n matrix without using any loop or build in function (except size()). is it even possible? I tried something like this: ...
0
votes
0answers
18 views

How to work around this apparent bug in fmincon (Matlab)?

I try to determine a maximum likelihood estimate using the Matlab routine fmincon. This routine needs as input an initial 'guess' $x_0$. For some values of $x_0$ it gets stuck in an infinite loop, ...
1
vote
0answers
29 views

PDE using $\theta$ method in Matlab

I'm trying to solve this problem numerically in Matlab: $ \left\{ \begin{array}{rl} \frac{\partial P}{\partial t} &= \frac{\partial^2 P}{\partial x^2} \ \ \ (\star) \\ P(x,0) &= 1 \\ ...
0
votes
0answers
36 views

MATLAB linear interpolation

I'm trying to write a MATLAB program to do linear interpolation and to check its accuracy. I have to input $x_0$ and $x_1$ and then generate the data values using $y=e^x$. Then, for a variety of ...
0
votes
1answer
20 views

Iterative Scheme-Programming Matlab

I don't know if this is going to seem like a dumb question, I am new to this and to matlab, but I'm trying to construct an iterative scheme in MATLAB to compute $\sqrt(b)$ for a given b>0, and program ...
0
votes
2answers
24 views

function with moving average on matlab

Do a function that maintains moving average, the function gives the average of all the numbers that have been put in the function. does anyone know how to do this ?
1
vote
1answer
88 views

what is the probability to find the a sequence of 5 or more continuous heads in coin tossing 100 times?

If an unbiased coin is tossed 100 times, what is the probability to find the a sequence of 5 or more continuous heads in the experiment? My Professor says there is no exact way (may be he meant easy ...
0
votes
1answer
31 views

Plotting null and column space of C

I can't figure out how to properly plot the null and column space of a certain matrix $C = \begin{pmatrix} 6 & -12 & 6 \\ 12 & -36 & 18 \\ 18 & -36 & 18 \end{pmatrix} ...
0
votes
2answers
17 views

Matlab Code for substituting numbers in variable matrix

In Matlab, if we input a number matrix say [1 2; 3 4; 5 6], then what should i do so that the output would be of the form $ [(x_i-z)^b \hspace{5mm} y_i]$ where $z$ and $b$ are just variables. ...