Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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/...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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. ...

más de 7 años hace | 1

| aceptada

Respondida
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)...

más de 7 años hace | 3

| aceptada

Respondida
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 ...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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 ...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 2

| aceptada

Respondida
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'...

más de 7 años hace | 2

| aceptada

Respondida
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...

más de 7 años hace | 2

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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...

más de 7 años hace | 1

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

más de 7 años hace | 0

| aceptada

Respondida
Maximum value of a normalized power changes
Hi pos, First of all, if you want to approximate the area, that's done with intervals and not with points. Just summing the ...

más de 7 años hace | 0

| aceptada

Cargar más