Answered
Problem with multiple values on plot
Hello Catherine, The last line will probably work if changed to text(L_val,L_pks,num2str(L_val'),'fontsize',12); this i...

9 years ago | 0

| accepted

Answered
error when using min function
Hi Andrew, this is a hypothetical answer but it may be that you have, somewhere else, defined 'min' to be a variable .e.g min ...

9 years ago | 2

| accepted

Answered
Is there a simpler way to produce an rgb image from a grayscale matrix based on custom thresholds?
Hello Andrew, Red = zeros(size(B)); Green = zeros(size(B)); Blue = zeros(size(B)); Red(B<=120) = 255; Blue(...

9 years ago | 0

| accepted

Answered
3D interpolation question
Hello S, You are close on this. Right now you are making a finer 81x81 matrix and looking at its 1,1 element, which is off in ...

9 years ago | 0

Answered
Using MATLAB i want to find a polynomial q(s) such that s5 + 7s4 + 20s3 + 30s2 +24s + 8 = p(s)q(s) . where as p(s) = s3 + 3s2 + 4s + 2.
Hi Husain, go to 'help deconv' and take a look at that function, keeping in mind that in Matlab a vector of polynomial coeffici...

9 years ago | 1

| accepted

Answered
inverse power method for smallest eigenvector calculation
Hello Turker, There is nothing wrong here. The eigenvalue equation is A*v = lambda*v and so for the eigenvector, both ...

9 years ago | 1

Answered
Duration & Calendar Duration. What is the difference?
Hello vc, Calyears and years are two different quantities. Calyears add a year, taking into account leap years, and gives th...

9 years ago | 2

| accepted

Answered
How does if(0) work within a function?
Hello Padma, if(0) always comes up false, so the operations after the 'else' statement will always be performed. It's a low-re...

9 years ago | 3

Answered
Please help, the value of a function is changing with the domain.
Hello Joshua, For each variable, try this with extra dots in the locations shown. This is because it appears that you want ter...

9 years ago | 0

| accepted

Answered
Normalization of the eigenvectors in eig(A) vs. eig(A,eye(length(A)); Orthonormality relationship
Hello Jerome, It's an interesting question why Mathworks chose not to normalize the column vectors in V2 and W2 when they did s...

9 years ago | 0

Answered
define associated legendre by hypergeometric functions
Hi Kurt, Probably the easiest thing to do is look up associated legendre polynomials on wikipedia, where they provide the expre...

9 years ago | 0

Answered
FFT in dB scale
hi Alexander I assume you are looking for a couple of peaks at -6 dB. Otherwise this answer will not be of help. But to get -...

9 years ago | 1

| accepted

Answered
Plotting plane through point arrays midpoint
Hi Chaosante, The basic problem here is that the equation for the plane is (in free notation) [(x,y,z)-(xmean,ymean,zmean)...

9 years ago | 0

| accepted

Answered
How the implement a 3-fold sum?
Hello Stephen, Here is one way, although you do make three arrays of the same size as M: [xx yy zz] = ndgrid(x,y,z); S ...

9 years ago | 0

| accepted

Answered
How can I solve y''+yy'=0, y(0)=1, y'(0)=-1 in matlab?
Hello Grace, y = -tan(x/2 - pi/4)

9 years ago | 0

Answered
Show that a larger number is bigger than another large number
Hello Delia, If what you need to know is which is larger, then John has certainly addressed that. However, I was thinking that ...

9 years ago | 0

Answered
Definite integral with complex number
Hello Diana, symbolic variables are a great thing, but if you are looking for a numerical result and are happy with 15 or so si...

9 years ago | 0

Answered
Energy calculated from an image doesn't match with the energy calculated from its Fourier transform
Hello IPN, I assume you mean sum(sum(...)) rather than sum(...). It appears that you are assuming a constant of proportionality...

9 years ago | 0

Answered
Polyfit on semilogy. Straight line equations and intercept point
Hello Emanuele, when you are looking at a semilogy plot you are interested in log(y) vs. x. So you need to go into log-land an...

9 years ago | 1

| accepted

Answered
How can I test if a number is irrational?
Hello Alexandre, although your interest is along conceptual lines, still it's fun to look at practical consequences. Supposing...

9 years ago | 0

Answered
How do I make this 2 dimensional vector follow a formula
Hello Jesse, The standard way to do this is with the meshgrid function: x = 1:10; % or whatever size it is y = 1:10...

9 years ago | 0

| accepted

Answered
frequency domain linear regression
Hi Jan, You are correct that k is the index corresponding to frequency. In an fft, k = 6 always corresponds to 6 oscillations ...

9 years ago | 0

Answered
Integral gives wrong answer
Hello Frank, This might be more of an observation than an answer, but one point not in your favor is that since log10(x) = log(...

9 years ago | 1

| accepted

Answered
I want to convert the output of transient analysis of cantilever beam from time domain to frequency domain, so i used the fft function as below. But i am not getting the correct answer. Please anyone can help me to solve this problem
Hi Siddesha, please format your code by highlighting it, using the {}Code button and using ENTER if necessary to make individual...

9 years ago | 0

| accepted

Answered
Issue plotting maximum and minimum roots of polynomial
Hi Peter, I believe that the basic problem here is the three lines of code T(i) = 63.2 + i; Tre = T(i)/Tc; f = A...

9 years ago | 0

Answered
How to convert the x an y axis to frequency in plotting 2D FFT?
Hi Poorva, If what you are ffting is truly a 2d time array, then there will be a sampling frequency for each direction. In tha...

9 years ago | 0

Answered
Why are the peaks of my spectrum not exactly at the frequencies of my sinusoidal input signal?
Hi Luc, I don't believe that the fft or ifft is necessarily inaccurate just because it is discrete or has finite boundaries. Y...

9 years ago | 0

| accepted

Answered
Combine phase and magnitude of a 2D fourier transform in one image?
Hello Dai, If you are not aware of the function hsv2rgb you should check into it, since if you properly input mag and phase it ...

9 years ago | 0

| accepted

Answered
Evaluate integral of vectorial function
Hello Davide, I believe an explicit solution is cvec = .01:.01:20; q = []; for c = cvec R = roots([1 0 -2 -c]); ...

9 years ago | 0

Load more