Réponse apportée
Interweave two arrays in a specific pattern
x = [1:160]'; y = x; xx = reshape(x,16,[])'; yy = reshape(y,16,[])'; zz = [xx,yy]'; z = zz(:);

plus de 6 ans il y a | 0

Réponse apportée
it's plotting empty figures
I made some adjustments. Let me know if this is close to what you want. tau = [1.5, 2]; figure for t = 1:length(tau) ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Merging vectors into one
Simple: x = 1:10; y = x + 10; % for example % x and y are both [1x10] row vectors as you mentioned z = [x(:), y(:)]; % z i...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
ECG spectrum wrong?
I'm not sure how you're doing your notch filters, but try this: Fs = 625; % or whatever your sampling frequency is. Fn = Fs/2;...

plus de 6 ans il y a | 1

Réponse apportée
How to avoid error when whether the function has returns is unknown?
You can use *nargout*(|Function|) to check the number of output arguments. <https://www.mathworks.com/help/matlab/ref/nargout.h...

plus de 6 ans il y a | 0

Réponse apportée
eval(sprintf('left = X+X%d+X%d+X%d+X%d+X%d+X%d', i==1:6)); throws error Undefined function or variable 'X0'. why
Forget about it. <https://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically...

plus de 6 ans il y a | 1

Réponse apportée
Yet another "Dot indexing is not supported for variables of this type"
First of all, bravo for posting a very comprehensive question that is self-contained. Most people don't do this and it makes it ...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
time series fatigue test
You can follow this example: lb = 5; % lower bound, ymin ub = 10; % upper bound N = 1000; % num samples vals = ran...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Dear fellows i am removing noise from( 3-200)HZ.
Let me link back to the previous time you asked this question, so other contributors can see the solution already provided. htt...

plus de 6 ans il y a | 0

Réponse apportée
Plotting continious-time signal
That's correct. You plotted three signals, with angular frequency of pi, 3/2*pi, and 2*pi rad/s. This corresponds to frequency o...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How to replace a string with another string in specific table columns
t{:,index} = regexprep(t{:,index},'\[\]','-99')

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Cody question help: Remove all the words that end with "ain"
You are overcomplicating things. You have it with this expression regexp(s1, '\w*ain\>') But that just returns a set of indice...

plus de 6 ans il y a | 0

Réponse apportée
Non constant Sampling Frequency in FFT of Amplitude Modulation
Why do you want a non-constant sampling frequency? I don't understand the advantages of that, and there are plenty of disadvanta...

plus de 6 ans il y a | 0

Réponse apportée
storing for loop answer into matrix
It would often be much faster for you to just look up the documentation than to post a question here and wait for an answer. I s...

plus de 6 ans il y a | 1

Réponse apportée
How to display values from a chart into the command window
If you want the end value, then do coord = [x(end) y(end) z(end)] If you want the value when z = 0, assuming it equals e...

plus de 6 ans il y a | 0

Réponse apportée
Creating permutations of vectors using basic matlab commands such as loops.
You can do it in two lines of code by using *ndgrid*, and putting the four outputs column-wise into a matrix. That would be the ...

plus de 6 ans il y a | 0

Réponse apportée
Why is this fprintf not wprking correctly?
array = [studentNames;string(TotalAvg)]; fprintf('%s has an avg of %g\r\n',array);

plus de 6 ans il y a | 0

Réponse apportée
How to make a new stop in a vector when matlab reads a specific symbol?
help str2double help cell2mat

plus de 6 ans il y a | 0

Réponse apportée
Output argument "y" (and maybe others) not assigned during call
What is the function supposed to return for y = ycal(1,0,0)? It doesn't pass any of the conditionals in the if statement. And si...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Scatter doen not plot!
Put this line _outside_ the loop over |swarm.nb_drones|, or only the last iteration will be non zero. self.wake = zeros(10,...

plus de 6 ans il y a | 1

Réponse apportée
ECG spectrum wrong?
I'd say it looks fairly normal once you notch filter the line noise. But there is other preprocessing to do, like a low pass fil...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
how can i make an array of frequency after doing fft which helps to identify the keypad number? i have included my script
You would have to calibrate each keypad to a specific frequency first, then compare what the user typed in to your calibrated pe...

plus de 6 ans il y a | 0

Réponse apportée
help me understand accumarray
OK, so the subs matrix represent the rows and columns of the matrix A. (1, 1) represent the first row and first column. (3, 2) r...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
how to set limits of integration (for example: 0:inf) for a vector using trapz tool ?
Your vector of frequencies is not correct, because fft returns the negative frequencies first, followed by the positive frequenc...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
how to produce multtiple stacked plots with different colors in a for loop?
You can use the power of colormaps (link) to do this. Here is an example: t = 0:0.001:1; figure col = jet(60); for k = 1:60 ...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Zooming a portion of figure in a figure
I just made some minor adjustments close all L = 0.01; R = 0.1; K_i = 800; K_p = [0.8, 1.2, 2, 4, 10, 40, 100]; figure...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Find duplicate entries and average them
% original data x = [0, 10, 20, 20, 20, 30, 40, 50, 50, 70]; y = [0, 10, 10, 20, 20, 30, 40, 50, 60, 60]; z = [10, 20, 40...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to plot like the inserted picture?
You need to first collect all your values for yticks and labels, then set them all at once. For example nfiles = 10; for a = 1...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Time-frequency spectral coherence analysis
Have you looked at the MATLAB function mscohere? Otherwise, you could try looking into this function in the spm12 toolbox: spm_...

plus de 6 ans il y a | 0

Réponse apportée
i made a program that runs with the sound program but no sound comes out
The file is handel without a capital letter H. Same for gong. You can check the others. Once you load the file you have to play ...

plus de 6 ans il y a | 0

Charger plus