Answered
how to explain that integral(sqrt,0.5,1) does not work?
Hi YZ, try integral(@sqrt,.5,1) It's syntax ...

8 years ago | 0

| accepted

Answered
Finding the area under a semilogy plot with straight line segments
Hi Arun, You have four intervals, each defined by start and end points (x1,y1) and (x2,y2). In each interval, y is of the fo...

8 years ago | 0

Answered
Computing frequency from phase angle. How to remove the frequency spikes?
Hi Jan, The angle function is restricted to -pi < angle < pi, so in your first plot the angle has a series of sudden jumps fr...

8 years ago | 1

| accepted

Answered
Finding Accurate Amplitude Using FFT
Hi Andy, When I run your code I get 14.5 for the answer, so I am not sure how you are getting 54.8. But the 14.5 is consiste...

8 years ago | 0

| accepted

Answered
I want to plot a numerical integral which is dependent of x and y as the z-value in a surface plot. How can I do this?
Hi Elke, The integral is just the Matlab normcdf function. With the supplied values the following code gives a plot that is ...

8 years ago | 1

| accepted

Answered
shifted summation (sliding window) without loop for high dimension vectors?
Hello Ca Parvulus, Here is a method that shifts the 50 columns rather than the 4e6 rows. To get your code to work I had to...

8 years ago | 0

Answered
how to get a value using integral
Hello Jongnam, try format long fun = @(x) x.^(7/2)./(sqrt(x-1)) integral(fun,0,1) ans = 0.000000000000000 - 0.8...

8 years ago | 0

| accepted

Answered
eul2rotm missmatch why?
Hello Wouter, I don't have the robotics toolbox, but in the documentation for eul2rotm it says: "When using the rotation m...

8 years ago | 0

Answered
Plotting irregular volume of given vertices.
Hi syham, Here is an example using patch. n = 6; x = rand(1,n); y = rand(1,n); z = rand(1,n); k = convhu...

8 years ago | 0

| accepted

Answered
FFT of a sinusoidal function
Hi Francesco, For an N-point fft, the usual way to set up the time and frequency arrays of step size dt and df is dt = 1/F...

8 years ago | 1

Answered
Calculating effective area in Soccer
Hi William, The algorithm draws a lot of triangles with players at the vertices. I appears that the final result for P is th...

8 years ago | 1

| accepted

Answered
Incorrect phase from fourier transform
Hi Nathan, If you check you will see that the difference between random_phase and phase is always either 0 or 2pi. This is b...

8 years ago | 0

| accepted

Answered
How to write program for [A(drager)^n, A^n].
Hi Samrat, You can't represent Adag and A by finite-dimensional matrices. Let's assume adag and a are NxN matrices that have...

8 years ago | 0

Answered
Getting a plot to wrap from right to left
Hi Bill, You have six points whose real starting point is evidently at x = -65. The idea here is to take the two leftmost x ...

8 years ago | 0

| accepted

Answered
Solving (x*y)^y == gamma((x+2)*y)/gamma((x+1)*y) for integer values of x.
Hello Christopher, N = 100; soln = zeros(1,N) for x = 1:N fun = @(y) (x*y)^y - gamma((x+2)*y)/gamma((x+1)*y); ...

8 years ago | 0

Answered
how to fin dalta from this equation
Hello Hussein, A plot of the equation shows that there are three real roots: x = -2:.001:6; figure(1) y = x + 1.6*...

8 years ago | 0

Answered
how to make a function (named pcc ) that solves the cartesian product of 2 strings A(with n elements) and B(with m elements)?
Hi Cosmin, If by 'strings' you mean vectors of characters then there are questions about how to accomplish multiplication. I...

8 years ago | 0

Answered
Say I have a loglog plot, how could I add diagonal lines of 45 and 135 degrees onto the plot?
Hi Mark, If by 45 degrees you mean one y decade per x decade, regardless of the aspect ratio of the plot, then x = [1 1e...

8 years ago | 0

| accepted

Answered
FFT of Gaussian Pulse in Time Domain
Hello Francesco, It appears that you are looking for the kind fft normalization that approximates a Fourier transform. If th...

8 years ago | 1

| accepted

Answered
Matrix dimensions must agree. How can i fix it?
Hi Guiseppe, You need to do ./ (dot divide) rather than / (divide). That way each element of the denominator is independentl...

8 years ago | 0

| accepted

Answered
Why does my code for frequency analysis work only with signals obtained by the combination of sinusoids?
Hi Edoardo, Is there is something going on in your code so that you are not looking at the fft that you think you are looking...

8 years ago | 0

Answered
concatenating vectors generated with loop
Hi alpedhuez, define output2 by putting output2 = []; just before the do loop. Unless you are using the intermediate...

8 years ago | 1

| accepted

Answered
Say I have 6 values of length of the antenna.How do I plot each radiation pattern corresponding to the lengths in a single polar plot?
Hi Soumyadeep, Do you have version 2016a or later? If so you can replace polar(t,E) with polarplot(t,E) and get the right re...

8 years ago | 0

| accepted

Answered
How do I get all solutions of the equation cos(x)==cos(3x) using solve() from Symbolic Math Toolbox ?
Hi Angelo, You didn't go wrong, it's missing half of the roots. But this works h(x)=sin(x+pi/2)==sin(3*x+pi/2); go f...

8 years ago | 0

Answered
Chebyshev polynomials of the first kind
Hi Asli If you get the do loop out of the code so that the three lines for n=0:6 pol=toplam + 2.*(x).*cheby(n-1,x)-cheb...

8 years ago | 2

| accepted

Answered
How to adjust the period of a sawtooth graph
Hi Audrey, you want to have the sawtooth start over at x = 1, but the sawtooth function starts over when its argument gets to 2*...

8 years ago | 0

| accepted

Answered
How do I rearrange this transfer function to be in negative powers of z using matlab?
Hi Zach, if you divide numerator and denominator by z^-4 you obtain (2 -5*(z^-1) +13.48*(z^-2) -7.78*(z^-3) +9*(z^-4))/(4 ...

8 years ago | 0

Answered
Why does my acceleration scope in an impact simulation accelerate to 1300 m/s^2 for the first .0004s of impact when the velocity is only 4 m/s?
Hi Ryan, Actually the acceleration could have been a lot larger. Suppose del_v = is the change in velocity in the time inter...

8 years ago | 0

| accepted

Answered
How to compute the mean amplitude of each frequency across trials?
Hi Becky, I assume you have trials changing down, time changing across (each row is a trial as a function of time). The firs...

8 years ago | 0

| accepted

Answered
How to generate a matrix with the same correlation coefficient between all variables?
Hi David, MODIFIED the next thing that comes to mind is a = [2*ones(1,4);-2*eye(4);zeros(5,4)] + 5; a = ...

8 years ago | 1

Load more