Answered
How to plot several vectors from origin?
Hi, see the reference page for quiver u = zeros(2,1); v = zeros(2,1); x = randn(2,1); y = randn(2,1); quiver(u,v,x,y)...

14 years ago | 0

Answered
amplitude spectrum
There are a couple things you can do. Let x be your speech signal and fs your sampling frequency. The following two are power es...

14 years ago | 0

| accepted

Answered
How to see the freq response of a transfer function
Hi, I'm going to assume that by z(2) you mean z^{-2}. You can do a couple things. [H,W] = freqz([1 0 0.5],[1 0 1]); p...

14 years ago | 0

| accepted

Answered
Wavwrite doesn't work
Are you getting any error messages in the command line? Enter >>pwd at the command prompt. Is this the same place...

14 years ago | 0

Answered
my code doesnt go into the loop
That is not correct syntax for a while loop. For example: % This does not work! n = 1; while (n==1:4) disp('Hi'); ...

14 years ago | 0

| accepted

Answered
Can matlab give me difference equation from transfer fucntion
I think I'm trying to say that you see it right away if you have the Z-transform. Do you have the System Identification Toolbox?...

14 years ago | 0

| accepted

Answered
Can matlab give me difference equation from transfer fucntion
You have the difference equation: H(z)= (1-z(-1)) / (1-3z(-1)+2z(-2)) y(n)-3*y(n-1)+2*y(n-2) = x(n)-x(n-1); zplane([1...

14 years ago | 0

Answered
The min(y) function where y is a vector
[minval,index] = min(y); In this case it's trivial since index is the x value at which the minimum occurs. This function is...

14 years ago | 0

Answered
help how could read 2 or more wav file
y = cell(2,1); for nn = 2:3 filename = ['videoplayback' num2str(nn) '.wav']; y{nn-1} = wavread(filename); ...

14 years ago | 0

| accepted

Answered
Default parameter if the user input is empty?
s = input('Enter a number\n'); if isempty(s) s = 3; end

14 years ago | 8

| accepted

Answered
How do I apply my filter to my image? (first matlab project)
Since you're filtering an image, I would create a 2-D separable filter and use filter2. filter() will just apply a 1-D filter to...

14 years ago | 1

Answered
How to extract the values that I want in a cell array?
How is this different than the answer I gave before? a={1,17951,1,0 ; 1,20345,1,0 ; 1,22950,1,0 ; 1,25360,1,0}; b = cell...

14 years ago | 0

Answered
The function for determining the position of a given value in an array.
x = ones(1e3,1); x(750:end) = 0; index = find(x == 0,1); If you want to find the first K values. K = 3; indices = fi...

14 years ago | 0

| accepted

Answered
how to compare two values
apple=[56 90 23 12 34]; orange=[23 45 56 90 10]; data = [apple' orange']; hbar = bar(data); set(hbar(1),'facecolor',[1...

14 years ago | 0

| accepted

Answered
How to exclude unwanted numbers in a cell?
a={1,17951,1,0 ; 1,20345,1,0 ; 1,22950,1,0 ; 1,25360,1,0}; b = cellfun(@(x) x(x>1),a,'uni',0); b(cellfun(@isempty,b))=...

14 years ago | 0

| accepted

Answered
Very small p value
Hi Micah, A couple things to try: Set the format to long. format long [h,p] = chi2gof(histdata) It may be that th...

14 years ago | 0

| accepted

Answered
correlation of signals
You may also want to read over my examples in this thread: <http://www.mathworks.com/matlabcentral/answers/20741-correlation>...

14 years ago | 0

Answered
correlation of signals
Don't leave the semicolon off. And look for where the maximum occurs. x = cos(pi/4*n); y = cos(pi/4*n-(3*pi)/4); ...

14 years ago | 0

Answered
corrcoef & xcorr
Salvatore, corrcoef() is not the cross correlation sequence. It does not shift one vector with respect to the other. x = cos...

14 years ago | 1

| accepted

Answered
??? Undefined function or method 'hw1_p2_x_vs_k' for input arguments of type 'double'. "
In addition to Walter's suggestion, also check that you have saved that function in a folder on the MATLAB path. If you enter ...

14 years ago | 0

Answered
labelling x axis vertically
You mean you want the bar graphs extending from the vertical axis? x = 1:4; y = randperm(4); barh(x,y);

14 years ago | 0

Answered
Toolbox Installation Problem
Hi Amy, Mathworks offers very good installation support. You should contact them for this question. http://www.mathworks.com/...

14 years ago | 0

Answered
How to similuate a coin flip with probablility p
100 tosses with p=0.5. x = round(rand(100,1)); If you want a probability other than p=0.5, then realize that rand() is unifo...

14 years ago | 5

| accepted

Answered
Vector x produce another vector s
Well, without just doing everything for you. Your x vector runs over an interval of 8. So, if the sine wave has 2 periods in 8 x...

14 years ago | 0

Answered
error in for loop
you're changing the value each time through the for loops. How about: out=[3 4 5 6 7 8]; out1=[1 2 3 4 5 6]; for n...

14 years ago | 0

| accepted

Answered
computing cwt only at scale 5
Hi Claire, yes, your code is correct, but are you sure you don't want to include at least a few more scales? That can help in...

14 years ago | 1

| accepted

Answered
notation
Then somefunction.m does not take input arguments for example: function x = somefunction x = 2; end if you call ...

14 years ago | 0

| accepted

Answered
Vector operations
One way: a = [1,2,5]; b = reshape(repmat(a,4,1),12,1);

14 years ago | 0

| accepted

Answered
notation
The way you've written it, it implies that you are calling a function called somefunction that returns an output x. Inside the p...

14 years ago | 0

Answered
the order of a quasi stationary segment to be filtered
You can use information-theoretic criteria. For a specific example in MATLAB using the System Identification Toolbox, please see...

14 years ago | 0

Load more