Respondida
Function in Matlab
I'm not exact sure what you are asking, so perhaps you can clarify. You can declare a variable to be global >> global ...

más de 14 años hace | 0

Respondida
avoiding for loop
A=[1 2 3 4 5]'; B=[4 5 6 2 1]'; C = [A B]; D = C(:,2)-C(:,1); out = [sum(C(D>0,:),2); diff(C(D<=0,:),[],2)]

más de 14 años hace | 0

Respondida
creation of exe file
See the help for mcc and mccinstaller and deploytool The documentation walks you through a simple example: <http://www.mat...

más de 14 años hace | 0

Respondida
How to implement nise of specific bandwidth?
Take a broadband noise and the use a bandpass filter. Keep in the mind that the noise samples will be autocorrelated after you u...

más de 14 años hace | 0

| aceptada

Respondida
How to round the decimals?
One way here is: X = 0.135678; format bank; X Another way is: format; %just returning the formatting ...

más de 14 años hace | 0

Respondida
Append/Alter string in Title
plot(randn(100,1)); h = title('Test'); origtitle = get(h,'String'); set(h,'String',[origtitle ' 2'])

más de 14 años hace | 1

| aceptada

Respondida
imfilter
Zhang, the difference is that there is a rotation of the kernel by 180 degrees (pi radians) between the two. So for: h...

más de 14 años hace | 0

| aceptada

Respondida
imfilter and filter2
Yes, they are the same in some instances: h = 1/100*ones(10,10); x = randn(20,20); y = filter2(h,x); y1 = ...

más de 14 años hace | 0

| aceptada

Respondida
How to use Semilogy in MATLAB
Why are you using semilogy in a for loop where you are only plotting a single value for A at a time? Save the values of A in ...

más de 14 años hace | 0

Respondida
Sin Cos calculation for a regression
The (2*pi) is just because you are converting the frequencies from cycles\day into radians\day. When you then multiply that by d...

más de 14 años hace | 0

| aceptada

Respondida
3D image
What format is it? You can use imread() for a number of formats. If it is just stored in a .mat file, then use load()

más de 14 años hace | 0

Respondida
Regression Fit a SinWave to a dataset?
You are not using what I gave you. You are using %betahat = X/y; Look at the example I gave you: y = score(:); %make...

más de 14 años hace | 0

Respondida
Regression Fit a SinWave to a dataset?
Because when you do a spectral analysis, the frequency spacing in your case is 1/501. So you only get frequency estimates at 0, ...

más de 14 años hace | 0

Respondida
Regression Fit a SinWave to a dataset?
Something is probably off in your spectral analysis in identifying the frequency. You have 501 points, which means the spacing b...

más de 14 años hace | 0

| aceptada

Respondida
Turning array values into values on an x axis
x = ones(500,1); indices = [2 3 6 9]; x(indices) = 2; Or x = ones(500,1); x(indices) = x(indices)+1;

más de 14 años hace | 1

| aceptada

Respondida
How do i create a matrix of size 1 row and 1501 column, with values [1 -1 1 -1 1 -1.... etc
One way: x = ones(1,1501); x(2:2:end) = -1*x(2:2:end); Another way y = repmat([1 -1],1,751); y(end) = [];

más de 14 años hace | 1

Respondida
Calculate the frequency range and plot the unwrapped phase spectrum
Honglei makes two good points in his comments. I'll assume you are talking about the distribution of the squared-magnitudes ...

más de 14 años hace | 0

| aceptada

Respondida
kmeans
You do the same thing except: plot(X(idx==1,1),X(idx==1,2),'r.','MarkerSize',10); hold on plot(X(idx==2,1),X(id...

más de 14 años hace | 0

| aceptada

Respondida
How do I Regression Fit a SinWave to a dataset?
You need to know what periods you want to fit. You had another post where you talked about fitting city population for a period ...

más de 14 años hace | 4

| aceptada

Respondida
what the right function ?
It looks to me like this function is ok. I mean you don't need the semicolons after the ends, but ok fine. Did you save this...

más de 14 años hace | 0

Respondida
Small Problem with 'if' statement and array index
This is a matrix as the first element of a cell array? If so (and if by line you mean row), then you want to address that by ...

más de 14 años hace | 0

Respondida
Writing data into an array
Can you be more specific what you mean by store? Images in MATLAB are naturally matrices, either 2-D matrices, or 3-D for someth...

más de 14 años hace | 0

Respondida
Autocorrelation function of sin(ωt) -- XCORR complications
To address your first question, the x-axis does not go up to 2000 seconds. What you have to keep in mind is that the autocorrela...

más de 14 años hace | 0

Respondida
sub2ind error
Your x and y vectors are not suitable for sub2ind(). You have an x vector that starts at 0 which is not a valid linear index in ...

más de 14 años hace | 1

Respondida
Fundamental Frequency
Yes,collect the F0 estimates in a vector and create a vector of times of equal length. Then just, plot(t,F0) However, y...

más de 14 años hace | 0

Respondida
How to use "zeros" to replace for loop?
frame1 = zeros(303,381,3);

más de 14 años hace | 0

Respondida
remove index
x = [10 2 3 5 15 7 8 100 2 10 12 23 20]; x(3:3:end) = [];

más de 14 años hace | 0

| aceptada

Respondida
Eigenvectors of a nonsymmetric matrix.
Below W are the left eigenvectors, use the one associate with the largest eigenvalue. If A is your matrix [W,D] = eig(A...

más de 14 años hace | 0

| aceptada

Respondida
Error- Subscript indices must either be real positive integers or logicals.
A couple things: 1.) Is this an RGB image? The 3-D wavelet transform is not suitable for an RGB image. The 3-D wavelet transf...

más de 14 años hace | 0

| aceptada

Respondida
plot grid
Are you sure you want to do that? You won't be able to see the xticklabels even if you make the font really small. Here is an...

más de 14 años hace | 0

| aceptada

Cargar más