Respondida
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(:);

más de 4 años hace | 0

Respondida
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) ...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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;...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

Respondida
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 ...

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

| aceptada

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

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 0

Respondida
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 ...

más de 4 años hace | 0

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

más de 4 años hace | 0

Respondida
How to make a new stop in a vector when matlab reads a specific symbol?
help str2double help cell2mat

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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,...

más de 4 años hace | 1

Respondida
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...

más de 4 años hace | 2

| aceptada

Respondida
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...

más de 4 años hace | 0

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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 ...

más de 4 años hace | 1

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 0

| aceptada

Respondida
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...

más de 4 años hace | 1

| aceptada

Respondida
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_...

más de 4 años hace | 0

Respondida
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 ...

más de 4 años hace | 0

Cargar más