Answered
find all zeros
You can use |roots|, for example for x^2-1=0 roots([1 0 -1]) http://www.mathworks.com/help/techdoc/ref/roots.html

14 years ago | 0

Answered
subplot axis scaling
You didn't specify x axis, that's why the x axis becomes the indices. Just do plot(y1,a)

14 years ago | 0

| accepted

Answered
In an assignment A(I) = B, the number of elements in B and I must be the same.
I don't quite know what your intention is, but the left side is a scalar and the right side in general is a vector, could be sca...

14 years ago | 0

Answered
Undefined function or variable when using load and trying to operate with variables
The first variable in |save| is the file name, not the variable name. So in each of your files, the variable name is still |z|. ...

14 years ago | 0

Answered
alternative to diff(X)
x = 1:10; x(2:end)-x(1:end-1)

14 years ago | 1

| accepted

Answered
day of the week in a month
You want to use if any(x==[2 9 16 23 30]) and so on. Also at the bottom, you seem to have an extra |else| hanging around...

14 years ago | 0

| accepted

Answered
Vectorization of this loop
x1=0; y1=1; inj_x=round(xwidth/2.0); inj_y=round(ywidth/2.0); [x2,y2] = ndgrid((1:ywidth)'-inj_y,(1:xwidth)'-inj_x...

14 years ago | 0

Answered
Why my butterworth low pass filter doesn't work?
I don't understand. I modified your code a bit to do * Use filter operation in time domain * Use 200Hz as cutoff frequency ...

14 years ago | 0

| accepted

Answered
Why my butterworth low pass filter doesn't work?
Please format your code. But just a quick note, if you set cutoff frequency at 300Hz, the 300Hz component will not be eliminated...

14 years ago | 0

Answered
help using fgetl function???
you should use while ~feof(fid)

14 years ago | 0

Answered
envelope function
For a signal x, you can use the following code to get the envelope t = 0:0.01:1; x = exp(-t).*sin(2*pi*10*t); plot(t,...

14 years ago | 0

Answered
Contour a log fuction with n contour levels
There are negative numbers in log so the result may be complex. In addition, there is zero in log, so log(0) gives infinity, whi...

14 years ago | 0

Answered
Levinson algorithm
Hi Shweta, It is true that the algorithm only solves n unknowns, but if you look at the reference page below, the returned re...

14 years ago | 0

Answered
Traping Error user input
Is this what you want? n=inputdlg('Please input a number more than or equal one:') while isempty(str2num(n{1})) || str2n...

14 years ago | 0

| accepted

Answered
How do I create a vector with a multiply sequence?
Another one flipud(100*diag(vander(repmat(0.7,1,10))))

14 years ago | 1

Answered
How do I create a vector with a multiply sequence?
Just for fun filter(1,[1 -0.7],[100 0 0 0 0 0 0 0 0 0])

14 years ago | 1

Answered
slicing multi-dimensionsal arrays
In your code, you only passed on data input to |cat|. You can try the following cat(1,ary3d(2,:,1),ary3d(2,:,2),ary3d(2,:,3)...

14 years ago | 0

Answered
Plotting 2 Matrices
You can try surf(matrix1,matrix2) and see if that's what you want.

14 years ago | 0

Answered
loglog graph analyses
loglog uses 10 based logarithm for both X and Y, so if the resulting figure is a straight line and you want to calculate the slo...

14 years ago | 0

Answered
Fourier Transform of Swept Sine Signal
Looks to me within 2 seconds your signal sweep from 0 to 800Hz, so it's not really a 400 Hz sweep. Given your signal is real, it...

14 years ago | 0

Answered
The question about signal power in watts
I assume your signal, |y|, is the voltage signal in volts, and the load is 1ohm, then the power is 0.5 watts Here is an examp...

14 years ago | 0

Answered
A little bit tricky 2d plots
1. plot([A B C]); 2. plotyy(X1,[A B],X2,C); but because MATLAB always do the x axis from smallest to largest, ...

14 years ago | 1

Solved


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

14 years ago

Answered
Changing the figure font
x = 1:10; plot(x,'LineWidth',4)

14 years ago | 0

| accepted

Answered
An error at modulation process
It seems taht your evelope1 is derived from the input sound, while your car1 has the dimension of t, so the two don't match in s...

14 years ago | 0

Answered
3d-dwt
You may also find the following demo useful http://www.mathworks.com/products/wavelet/demos.html?file=/products/demos/shippin...

14 years ago | 0

Answered
Making function to calculate value when user inputs date
I think you need more information. Given only month and date, how can you figure out the weekday information? Or is it for a giv...

14 years ago | 0

Solved


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

14 years ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

14 years ago

Solved


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

14 years ago

Load more