Beantwortet
FFT of Large CSV File - Fundamental doesn't match data or simple sine test case
Hi Calvin, this is yet another example of the destructive power of using nextpow2 with the fft in the wrong circumstances. I t...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Why does num2hex(1) return '3ff0000000000000' in MATLAB?
Hi Trevor, Unlike dec2hex, num2hex converts to IEEE 754 hex notation (64 bits) See https://babbage.cs.qc.cuny.edu/ieee-754.ol...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How to vectorize a product of a tensor and a vector.
Hi Moslem Here is one way, and it does test out faster than the for loop. How much faster depends on the sizes of what I calle...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
How to fit a line on the plane?
Hi M, Here is a way to fit a line in 2d with the equation a1*x1 + a2*x2 = 1 where (x1,x2) are (x,y). This representation get...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Extracting double from endless serial string
Hi Marcel, Here is another way. It produces one copy of the number whereas in your case str2double(Value) produces a 3x1 matri...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
ODE45 2DOF Unable to perform assignment because the left and right sides have a different number of elements.
HI Piotr, I decided to post one last observation as an answer, which you may respond to as you wish. Since you have a couple o...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Identifying wave-number sign after applying 2-dimensional FFT
HI Bharati, WIthout going through the code in and detail (nice plot) I think the reason is the following. The cos wave is (1/...

mehr als 7 Jahre vor | 1

Beantwortet
How to find velocity and position of this ODE
Hi Peter, since you have defined s(2) = ds(1)/dt, s(2) is the velocity function already. No more work required, exceptto plot...

mehr als 7 Jahre vor | 0

Beantwortet
How do I call a function within another function?
[ MODIFIED to use the terminology 'nested functions'] Hi Sterling, You can define nested functions within other functions as i...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
How do I get an array to display the list of float values?
Hi R^2, For array A, a quick answer is num2str(A) or disp(num2str(A)); which outputs a character array to look at. Sometime...

mehr als 7 Jahre vor | 0

Beantwortet
How to take an integral of a matrix
Hi Radik, I assume you basically want to integrate each element in the resulting product matrix. Lots of inner and outer produ...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting error for Bessel Function for "large" input values.
Hi Greg, Time to look at logs. The bessel function has a scaled version that keeps it from blowing up, and you can look at the...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
solving an implicit ordinary differential equation
Hi Nariman, I assume that the two functions you show as f are not the same function, so I will denote the second one as g. And...

mehr als 7 Jahre vor | 0

Beantwortet
About changing and adding path
Hi Raphael, See 'genpath' for how to create a string of a folder and all its subfolders (with some exceptions), then you can us...

mehr als 7 Jahre vor | 0

Beantwortet
in desperate need for help (Trigonometric equation)
Hi solo, In situations like this it never hurts to plot out the function to see the zero crossings. I don't think people do th...

mehr als 7 Jahre vor | 1

Beantwortet
convert vector a to b
Hi nurhayat, try [~, b] = sort(a) so that b is the set of indices of a such that a(1) = 1, a(2) = 2, a(5) = 3, a(3) = 4 etc. ...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
How to write the colormap code for the colorbar presented in the figure?
Hi Naresh, Even if all you have is the jpg you can still make progess. I called the the jpg image A, and figure(1) image(A)...

mehr als 7 Jahre vor | 3

| akzeptiert

Beantwortet
Clarification regarding FFT required
Hello Dor, You are right about dividing by fs in this context, but in many other situations you divide by N, the number of fft ...

mehr als 7 Jahre vor | 1

Beantwortet
Is there a more simple way to express this? How can I simplify everything under "case 2"? Is there an alternative to writing out everything under case 2?
Hi TSmith, you can get rid of one redundant line by replacing leapYear = (answer(1) == 'y'); if leapYear wit...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
frequency error at fft of cos
Hi JC, I will not attempt to figure out what went wrong, but try n = length(t1); feq = (-n/2:n/2-1)*(Fs/n); also, dividing b...

mehr als 7 Jahre vor | 0

Beantwortet
sampled signal fft signal
Hi yuval, You don't have to bother with omega since the fft operates with straight frequency. I arbitrarily picked the number ...

mehr als 7 Jahre vor | 0

| akzeptiert

Beantwortet
why 97 and 65?
Hi Mintra, this is quite likely related to the ascii character set char(97) ans = 'a' char(65) ans = 'A' small lette...

mehr als 7 Jahre vor | 1

Beantwortet
Can any one please tell me that why the loop is running nXn times?
Hi Gaurav, You are only matching up to speaker 1 because in the 'test' function, variable x might equal zero but if not, it's h...

mehr als 7 Jahre vor | 1

| akzeptiert

Beantwortet
Inverse Laplace contains a complex number
Hi Karl You show one of the terms, and I assume you have another one that is the complex conjugate that one so that the entire ...

mehr als 7 Jahre vor | 2

| akzeptiert

Beantwortet
Hello everyone, how can I find a numerical solution of the following equation for “sigma_z”, which involves Bessel functions of first and third kind?
Hi Naveed, I am guessing that this is part of the solution for the TE modes in a fiber optic cable. I ran some code and I don'...

mehr als 7 Jahre vor | 2

| akzeptiert

Beantwortet
Rank function returning two different values to the same matrix
Hi Subash, It's not the same construction process at all. Try it with smaller numbers, and integers: m = 5; n = 4; A = rand...

mehr als 7 Jahre vor | 2

Beantwortet
Hello, I am new to Matlab and I need help with an error that pops up when I try to run my code. I don't understand why the error "Index exceeds matrix dimensions" pops up for my equation solving for variable D.
Hi Isabel, A couple of things. First, since you want to keep f1 as a vector for the plot, the f1 line in the 'if' statement ne...

mehr als 7 Jahre vor | 0

Beantwortet
Evaluating normal inverse when probability is close to zero
Hi Mike, Of course there is always the question if the normal pdf could still apply that far out in the tails, but that is assu...

mehr als 7 Jahre vor | 1

Beantwortet
Want a random matrix which has a negative eigenvalues
Hi Jon, The sum of the eigenvalues of a matrix equals the trace of the matrix. If all eigenvalues are negative their sum would...

mehr als 7 Jahre vor | 1

Beantwortet
Simple questions on Mechanical Vibrations
Hi y z l, try plot(w,amp) which looks pretty good.

mehr als 7 Jahre vor | 0

| akzeptiert

Mehr laden