Respondida
How can I multiply matrix with multiple vectors without loop?
Hello K M, You do this exactly as you have written it. T = [T1 T2 T3 .... Tn]; % concatenate as many 3x1 column vecto...

alrededor de 9 años hace | 1

| aceptada

Respondida
Fourier transform of standard mollifier
Hello Marco, I don't think it's likely that there is an explicit expression for the Fourier transform, so it will have to be nu...

alrededor de 9 años hace | 1

Respondida
Cannot fit this function sqrt((xs)^2+(ys)^2)-sqrt((xs-.65*cos(x))^2+(ys-.65*sin(x))^2)
Hello Guillermo, This isn't the answer you are looking for, but I don't believe a solution is possible. It is not hard to sh...

alrededor de 9 años hace | 1

| aceptada

Respondida
I have a problem interpreting reshape with a matrix product
Hello Simone, state = reshape(Psi0,n,n); % Psi0 is n^2 x 1 column vector ...

alrededor de 9 años hace | 2

| aceptada

Respondida
How to index time interval more efficiently?
Hi balandong, Here is one way to accomplish this. At present the function in the script below has no semicolons at the end o...

alrededor de 9 años hace | 1

| aceptada

Respondida
how to do fft to a gaussian function
Hello Shijie, This is happening because of basic behavior of ffts. For an N-point fft, suppose f(k) is the fourier transform...

alrededor de 9 años hace | 0

Respondida
How do I vectorize the following the summation?
Hi Cache, To obtain G, the sum over the row index i of matrix x leads to the product G = x.'*x as you determined. ...

alrededor de 9 años hace | 3

| aceptada

Respondida
Circle in a matrix
Hi Melissa, Here is a fairly simple method that makes a softer edge by adding up contributions from the point itself and its ...

alrededor de 9 años hace | 2

| aceptada

Respondida
I wish to get the spectrum (Magnitude vs Frequency(Hz)) of a pure tone(1 kHz). However, the piece of code I'm employing to do so isn't working. What am I doing wrong?
Hello Komal, The whole point of using fftshift is to put zero frequency at the center of the resulting frequency array. If y...

alrededor de 9 años hace | 0

| aceptada

Respondida
Optimize RAM cost by only storing upper triangular part of a symmetric matrix?
Hello Xh Du, The upside here is that if you have several square upper triangular matrices of the same size, you can efficient...

alrededor de 9 años hace | 0

Respondida
Surf Plot using loops- Z must be a matrix, not a scalar or vector.
Hi Fabricio, the z vector does not survive (except for its last value) after the for loop. z is a scalar at that point. So yo...

alrededor de 9 años hace | 0

| aceptada

Respondida
Plot the vector field of a first order ODE
Hi Tanja, Since the exponetial function creates such a wide range of values, I like your idea in the second code of plotting un...

alrededor de 9 años hace | 0

Respondida
divide matrix into equal parts of 7 columns
Hi soepblik, Is the first piece entries 1:7 in your matrix, the second piece entries 8:14, etc? If that's not the case then ...

alrededor de 9 años hace | 0

Respondida
Find out indexes of zeroed elements in matrix
Hi lucksBi, the find command gives you the row and column indices for a given condition. The find command searches column by co...

alrededor de 9 años hace | 0

| aceptada

Respondida
Interpolating a function that is constant over some parts of its domain?
Hi Jonathan, just swap inputs, interp1([-10,0,1,10], [0,0,1,1], x)

alrededor de 9 años hace | 0

| aceptada

Respondida
explain sparse convolution algorithm
Hi Robert, Since the posted code is oriented toward sparse matrices, it uses ‘find’ to eliminate the calculation for zeros co...

alrededor de 9 años hace | 0

Respondida
Null space vs eigenvectors
Hi Jeff, Since your eigenvalues are all distinct, what you have is basically correct. It's just that the eigenvector and the n...

alrededor de 9 años hace | 1

| aceptada

Respondida
Hysteresis Calculation of force profile
Hi Eric, yes that is correct, the negative sign is because the x coordinate is decreasing for IntegralRet. So all you need d...

alrededor de 9 años hace | 0

Respondida
Multiplying columns in a martrix by different values
Hi Eric, A(:,1) = A(:,1)*1e6 and similarly for the other one.

alrededor de 9 años hace | 0

| aceptada

Respondida
how to generate true random number
Hello, hu yes, Matlab random numbers are not truly random, but they are a very good simulation. The results you are seeing w...

alrededor de 9 años hace | 0

Respondida
Need help using Matlab for an approximation of Pi via the Mandelbrot set.
Hello Lauren, For all but your second question, the reasons are because if c = 1/4 + eps and there are n steps to get past 2,...

alrededor de 9 años hace | 1

| aceptada

Respondida
Euler totient function of number
Hi Mohsin, try N = 48; % for example n = 1:N-1; ind = gcd(n,N)==1; tot = n(ind) % check ...

alrededor de 9 años hace | 0

| aceptada

Respondida
where can I download durer.mat ?
Hi John, on my pc, >> which durer.mat C:\Program Files\MATLAB\R2016b\toolbox\matlab\demos\durer.mat so despite count...

alrededor de 9 años hace | 2

| aceptada

Respondida
Simple question: How to setup Matlab to calculate more precisely?
Hi Manuela, you have just discovered one of the features of floating point arithmetic. Matlab uses 64 memory bits for a floati...

alrededor de 9 años hace | 0

Respondida
Phase of 2D Gaussian Fourier Transform
Hello vittorio, all you need do is replace fz=fft2(z); with fz=fft2(ifftshift(z)); This is because in each dim...

alrededor de 9 años hace | 0

| aceptada

Respondida
Is there an easy (automated) way to determine if vertices are 'mutually adjacent' in a directed graph?
Hello Michael, what form is your data in? If it is the usual adjacency matrix A containing ones and zeros, with zeros on the d...

alrededor de 9 años hace | 0

Respondida
How can I fit a second Fourier component to a polar histogram?
Hi Eric, see how this works. I added an adjustable tilt angle to the random data to test the fit. The code compares the fit t...

alrededor de 9 años hace | 0

Respondida
Dipole antenna far-field pattern
Hi Vinci, power is proportional to the square of the electric field, so if you use E2 = abs((cos(B*L/2*cos(t))-cos(B*L/2))...

alrededor de 9 años hace | 2

| aceptada

Respondida
how to mesh a surface without interpolation of 3D points?
Hi shayan, the patch command may be what you are looking for. The following is a demo and could certainly be improved on codew...

alrededor de 9 años hace | 0

Respondida
How can I calculate the angle between two surfaces?
Hi Tobias, You get the components of the unit normals with [nx ny nz] = surfnorm(x,y,z) so if you have two surfaces z1 and z2, ...

alrededor de 9 años hace | 0

Cargar más