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

oltre 9 anni fa | 0

Risposto
Solving Matrix elements by using while iteration in Matlab
Hello nut, I suppose you could figure a convoluted way to use a while loop if you dreamed up some iterative process and stopped...

oltre 9 anni fa | 1

| accettato

Risposto
What is the Fourier transform of an Airy Disc?
[modified answer] Hi elham, The Fourier transform of the Airy intensity pattern is the autocorrelation of the aperture disks...

oltre 9 anni fa | 0

Risposto
Ignoring extra legend entries?
Hello Charlotte, you should be getting a pretty strange graph right now, since it would be plotting x vs y1 and then y2 vs y3. ...

oltre 9 anni fa | 1

| accettato

Risposto
Matrices in a matrix
Hi UGO, should your top row read R11, R12, R13? at any rate, try z = zeros(size(A)); C = [A z z;z A z;z z A]; B = C...

oltre 9 anni fa | 0

| accettato

Risposto
How can I get the 3d coordinates of a point by having its distance to some other points with known coordinates?
Hello payman, here is one way to accomplish this. There are always two solutions, given by the two row vectors s, which are re...

oltre 9 anni fa | 0

Risposto
Diagonally dominant matrix with high condition number
Hello othello, yes. a = [2e5 .1; .1 1]; cond(a) ans = 2.0000e+05

oltre 9 anni fa | 1

Risposto
Why do I get a different Phase graph, when using FFT versus hand calculations?
Hello Peter, This is pretty close and it definitely helps that it was complete working code. There are just a couple of thin...

oltre 9 anni fa | 1

| accettato

Risposto
creating random dense symmetric matrix with desired condition number
[modified to address the first comment below] Hi othello, I don't know about built-in functions but there are ways to make y...

oltre 9 anni fa | 1

Risposto
In for loop, add same fractional value to all non-integers in the vector
HI balsip, try for i = 1:length(A)

oltre 9 anni fa | 0

| accettato

Risposto
Finding the tan inverse for different range of values
Hello AK, consider the following two situations, where all phi obey -pi<angle<pi : case x phi1x = pi - pi/20 phi...

oltre 9 anni fa | 0

Risposto
Fast method count unique variables
Revised answer. For a 7e6 x 30 matrix this takes about 2.7 sec on my PC. m8 = uint8(m); u1 = uint8(1); ncol = size(m...

oltre 9 anni fa | 0

| accettato

Risposto
Correct reasoning of error propagation?
Hi Nicki, First off, you only see the values of h rounded to four decimal places. You can help your cause quite a bit by using...

oltre 9 anni fa | 1

Risposto
Numerical Methods to solve Equation
Hi Razi, the usual procedure is to use the 'break' condition start with a value (an initial value may or may not be needed...

oltre 9 anni fa | 0

| accettato

Risposto
fft function returns NaN from non-NaN input
Hi Yuwei, you did check for NaNs but not for any values that equal +-infinity, and there are three of them: >> find(isinf(...

oltre 9 anni fa | 3

| accettato

Risposto
How can i solve this problem ?
Hello Razi, The problem occurs in the statement x(i+1) = (3*x(i)+0.5)^(1/3) The (3x+1/2) part is negative for x <...

oltre 9 anni fa | 0

| accettato

Risposto
How to specify the colors within a colorbar
Hi Carolyn, All you need do is change the colormap line to colormap(sort(Color, 'descend')); but make sure that you ha...

oltre 9 anni fa | 1

| accettato

Risposto
weird rounding error?
Yes, it's interesting that for some tasks such as addition and subtraction of quantities with a fixed number of decimal digits, ...

oltre 9 anni fa | 0

Risposto
How to take advantage of the TRIANGULAR structure of a matrix when solving a linear system involving it?
Hello Joao, if you go to 'doc \' you can see an overview of backslash. The algorithm checks for triangularity right at the beg...

oltre 9 anni fa | 0

Risposto
weird rounding error?
Hi Jason, this is just Computer Science 101. Since computers have only so many bits to describe floating point numbers, there ...

oltre 9 anni fa | 0

| accettato

Risposto
Fixed-displacement pump friction torque vs pressure gain coefficient
Hi Tom, If you convert units from cm^3/rev to m^3/rad, then the value itself picks up a factor of 1e-6/(2*pi) = 1.5915e-07, an...

oltre 9 anni fa | 0

Risposto
How do I convert a 3D RGB image to a grayscale image using the intensity formula (intensity=0.2989*red + 0.5870*green + 0.1140*blue)?
Hi Janel, Given your first three lines that define red green and blue, if you just take the appropriate sum of those as in your...

oltre 9 anni fa | 1

| accettato

Risposto
Formula not returning array
Hello Ian, you forgot to put a dot in front of the divide sign: ./ in order to create element-by-element division.

oltre 9 anni fa | 0

| accettato

Risposto
I am stuck in a question
Hello Arslan, (I checked this by ode45 but the principle should be the same). You are solving dy/dt = (1-y)*exp(-.1*y). For a...

oltre 9 anni fa | 0

Risposto
How to generate mixed exponential distribution random number using the command in MATLAB?
Hello Noor, The function below agrees with the function cited above for several choices of parameters that I have tried. For 1...

oltre 9 anni fa | 0

Risposto
Double Integral using Integral2 Error
Hi jack, I believe this is occurring because your definition of myfun_eqn8 uses the two variables z,phi, but the integrand m1.*...

oltre 9 anni fa | 1

Risposto
Can I find the inverse of a sparse matrix faster?
Hi Staf, Before attempting something as large as T = 2000 it's never a bad idea to try the same thing for T just a bit smaller,...

oltre 9 anni fa | 0

Risposto
Construct phase spectrum before IFFT
Hi Roderick, I see that what I said about dividing your angles by a factor of 2*length(...) was incorrect because that factor w...

oltre 9 anni fa | 2

| accettato

Risposto
How to stop a graph going below zero in
Hello Matui, several ways to do this. If you want to keep the x and y arrays the same length as they are, you could use the fi...

oltre 9 anni fa | 0

| accettato

Risposto
How to pull values out of a matrix using another matrix?
Hello Tudor, Here is one way: indx = find(matrix1==0) matrix2(indx) = 0 This works because 'find' looks at the eleme...

oltre 9 anni fa | 0

Carica altro