답변 있음
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(:);

5년 초과 전 | 0

답변 있음
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) ...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 1

| 수락됨

답변 있음
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;...

5년 초과 전 | 1

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 1

답변 있음
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 ...

5년 초과 전 | 1

| 수락됨

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

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 1

| 수락됨

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

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 1

답변 있음
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...

5년 초과 전 | 0

답변 있음
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 ...

5년 초과 전 | 0

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

5년 초과 전 | 0

답변 있음
How to make a new stop in a vector when matlab reads a specific symbol?
help str2double help cell2mat

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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,...

5년 초과 전 | 1

답변 있음
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...

5년 초과 전 | 2

| 수락됨

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 1

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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 ...

5년 초과 전 | 1

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 1

| 수락됨

답변 있음
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_...

5년 초과 전 | 0

답변 있음
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 ...

5년 초과 전 | 0

더 보기