回答済み
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(:);

6年以上 前 | 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) ...

6年以上 前 | 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...

6年以上 前 | 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;...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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 ...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 1

| 採用済み

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

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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 ...

6年以上 前 | 0

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

6年以上 前 | 0

回答済み
How to make a new stop in a vector when matlab reads a specific symbol?
help str2double help cell2mat

6年以上 前 | 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...

6年以上 前 | 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,...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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 ...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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...

6年以上 前 | 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_...

6年以上 前 | 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 ...

6年以上 前 | 0

さらに読み込む