Réponse apportée
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 ...

environ 14 ans il y a | 0

Réponse apportée
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)]

environ 14 ans il y a | 0

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

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
How to round the decimals?
One way here is: X = 0.135678; format bank; X Another way is: format; %just returning the formatting ...

environ 14 ans il y a | 0

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

environ 14 ans il y a | 1

| A accepté

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

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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 ...

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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()

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
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, ...

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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;

environ 14 ans il y a | 1

| A accepté

Réponse apportée
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) = [];

environ 14 ans il y a | 1

Réponse apportée
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 ...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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 ...

environ 14 ans il y a | 4

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
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 ...

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
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 ...

environ 14 ans il y a | 1

Réponse apportée
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...

environ 14 ans il y a | 0

Réponse apportée
How to use "zeros" to replace for loop?
frame1 = zeros(303,381,3);

environ 14 ans il y a | 0

Réponse apportée
remove index
x = [10 2 3 5 15 7 8 100 2 10 12 23 20]; x(3:3:end) = [];

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 14 ans il y a | 0

| A accepté

Charger plus