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

circa 7 anni fa | 0

| accettato

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

circa 7 anni fa | 0

| accettato

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

circa 7 anni fa | 1

| accettato

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

circa 7 anni fa | 0

| accettato

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

circa 7 anni fa | 1

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

circa 7 anni fa | 0

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

circa 7 anni fa | 1

| accettato

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

circa 7 anni fa | 0

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

circa 7 anni fa | 0

| accettato

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

circa 7 anni fa | 0

| accettato

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

circa 7 anni fa | 0

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

circa 7 anni fa | 0

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

circa 7 anni fa | 1

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

oltre 7 anni fa | 1

| accettato

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

oltre 7 anni fa | 3

| accettato

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

oltre 7 anni fa | 1

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

oltre 7 anni fa | 1

| accettato

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

oltre 7 anni fa | 0

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

oltre 7 anni fa | 0

| accettato

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

oltre 7 anni fa | 1

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

oltre 7 anni fa | 1

| accettato

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

oltre 7 anni fa | 2

| accettato

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

oltre 7 anni fa | 2

| accettato

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

oltre 7 anni fa | 2

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

oltre 7 anni fa | 0

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

oltre 7 anni fa | 1

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

oltre 7 anni fa | 1

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

oltre 7 anni fa | 0

| accettato

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

oltre 7 anni fa | 0

| accettato

Risposto
Can someone tell me why my error is so large for my composite simpsons rule?
Hi Briyahna, Yes the Simpson's rule expression is wrong, but only in the typo sense of having a misplaced parenthesis. Inste...

oltre 7 anni fa | 0

| accettato

Carica altro