Answered
i need to find the stagnation point for the following code
Hello Anthony, Good looking result. If at the end you put figure(2) quiver(x,y,U1,V1) axis equal grid minor ...

8 years ago | 0

Answered
error Inner matrix dimensions must agree?
Hi safisay, presumably you want to multiply all the vectors together element-by-element so in the expression for M you have to ...

8 years ago | 0

| accepted

Answered
Overlapping time-intervals
Hi Rostislav It looks like you want the union of closed intervals. Here is some code that I think does the job. When the e...

8 years ago | 4

| accepted

Answered
Reading user input when input is a combination of letters?
Hi Stenila, You need to get the user input as a string using the 's' option, not the usual input. Right now Matlab thinks th...

8 years ago | 2

Answered
why it doesnt return inverse fourier transfrom?
Hi jasleen, It doesn't work because with the for loop you are giving ifft the elements of n1 one at a time. Each of those fo...

8 years ago | 0

Answered
Problem with finite difference
Hi Paul, You did not say what h is, but I took it to be 2/n. After replacing Mx with its transpose, which changes the sign o...

8 years ago | 0

Answered
A function smart enough to sort coordinates of block into sub-blocks?
Hi Xiaohan, Here is some code that creates a 4x3xn 3d matrix sqquares (misspelled on purpose) where each level of sqquares in...

8 years ago | 0

Answered
How to create a best fit line on a loglog scale graph with 3 different lines (3 different datas)
Hi ckN, ***** See Addendum to answer, below ****** After you find the fit coefficients with polyfit, then you can use poly...

8 years ago | 0

Answered
Help with FFT and Dominant Frequency
Hi Saad, The fft of a pulse train of uniform spikes is another pulse train of uniform spikes, not just a spike at a single fr...

8 years ago | 0

Answered
How do I get a outer loop in a polar plot in MATLAB
Hi Union Olive, If you replace U_total_1 = (A_sen *(Ang_freq*d)/c)*(Beta_1+cos(theta)); with U_total_1 = abs(A...

8 years ago | 0

| accepted

Answered
Why does my if statement do the opposite?
Hi Erwin The test h==-h is not a test for whether h is negative. This test is the same as 2*h==0 and always fails unless h =...

8 years ago | 0

| accepted

Answered
Understanding convolution, 'same' might give wrong result
Hi Silke, Yes, this is a direct result of using the 'same' option. If you take a look at the convolution without that option...

8 years ago | 1

Answered
fibonacci function in 2016
Hi Eric, If you don't have the symbolic toolbox you can do this numerically with the filter function which is part of basic M...

8 years ago | 1

Answered
How to integrate a distribution function for a specific interval?
Hi Nina, If this is not a misinterpretation of the problem, then it seems to work. I am assuming that the function ecdf is a...

8 years ago | 0

Answered
Why do I get this error for my gauss seidel code?
Hello Peter, try if sentinel == 1 && x(i) ~= 0 instead of if sentinel = 1 && x(i) ~= 0

8 years ago | 0

Answered
Fast Fourier Transformation (FFT) on low sampling rate data
Hi Muhammed, The highest frequency that you can get to with the fft is the Nyquist frequency, which is half the sampling rate...

8 years ago | 0

| accepted

Answered
Having trouble with "Matrix is singular to working precision" error, would be glad if you help
Hi utkuzzz, The command L/G is the same thing as L*inv(G), although computationally L/G is certainly the preferred way to do ...

8 years ago | 1

Answered
Fundamental issue with trapz() function (or not?)
Hi Alvin, --- Modified Answer ---- The width of the peak is around 1e-4. So for trapz to work, you need the spacing in t...

8 years ago | 0

| accepted

Answered
Inverse tangent inaccuracy?
Hi Robert, All you need do is replace the expression for theta4a by theta4a = 2*atand((-B +sqrt((B^2)-(4*A*C)))/(2*A)) ...

8 years ago | 1

| accepted

Answered
How do I do numerical summations or integrations?
Hi Natalia, To use 'integral' you have to make sure that your function can produce a vector output given a vector input of u ...

8 years ago | 0

Answered
How do I do numerical summations or integrations?
Hi Natalia, What Eric says is true in theory, but as with a lot of these kind of problems,you have to take a look at how many...

8 years ago | 0

Answered
How to solve this integral?
Hi Leonardo, You can do the integral in the following way. Let [p/4 - phi(x)] = u(x) where u(x) --> 0 as x --> inf...

8 years ago | 0

Answered
Simplify matrix to have ones in diagonal
Hi amintr, You can use d = diag(A); A_new = A./d; % newer versions of Matlab with implicit expansion b_n...

8 years ago | 0

Answered
Problem with fzero to solve transcendental equation
Hi Nihal, in the function definition, try deleting the * following the second incidence of 'exp'.

8 years ago | 0

Answered
Solving for unknown matrix?
Hi Andrew, I understand that you are looking for a symbolic solution, but if G were a matrix of numbers, then phi = C\G/...

8 years ago | 1

Answered
Extract surface coordinates from ellipsoid function
Hi LW, After you get x,y, and z, try A = [x(:),y(:),z(:)]

8 years ago | 1

| accepted

Answered
How to find normal vectors that lie inside a cone
Hi Queens, Here is a method based on the idea that for normal vectors inside the cone, the dot product of the normal vector w...

8 years ago | 0

Answered
Need angular momentum error < 1% - Don't know why error values aren't changing w/ changing time step
Hello Kyle, Right now you are calculating the orbit using r and v and you don't need any other variables to do that. However...

8 years ago | 0

Answered
Why does bsxfun produce different result than brute force mean?
Hello KAE, I believe that each method has a small problem. In the second method, since length(nRrow) = length(nCol) = 1, the...

8 years ago | 2

| accepted

Answered
How to swap values of two variables?
Hi Daniel, Take a look at the 'deal' command, in this case [b a] = deal(a,b)

8 years ago | 5

| accepted

Load more