답변 있음
Calculating mean of signal between certain time interval in a loop.
Use findchangepts to determine the constant time phase. Then calculate the mean.

대략 4년 전 | 0

답변 있음
answer orange badge abadonned?
Level8, MVP, Staff, Editor, *, ... Are these colorful badges useful or are they used to increase the level of certain chemicals...

대략 4년 전 | 1

답변 있음
HOW TO REPLACE SPECIFIC ELEMENTS IN A MATRICE?
A = rand(5, 5); A(2:3, 3) = 0; A(4, 3:5) = 0; Is this a homework question? If so: what a pity that you did not try it by yo...

대략 4년 전 | 0

| 수락됨

답변 있음
What is error array 3-by-0?
Let the debugger help you to analyse the problem. Type this in the command window: dbstop if error Then let the code run again...

대략 4년 전 | 0

| 수락됨

답변 있음
Find the values in the cell arrays that correspond to some specific indices
If I understand correctly, A and B are the existing input and you want to create C. Then: A = { [10 30 2] [2] [NaN] ; [4] [NaN]...

대략 4년 전 | 0

| 수락됨

답변 있음
Code get stuck with nested loop and computer crashes after
What is a_trials? It looks like you want to run 12560 iteration. You open two figures in each iteration, so there is a total of...

대략 4년 전 | 1

답변 있음
Deleted passed UIFigure handle on bootup of MATLABWindow
If you run this script twice, the persistent variable S contains the handle of the former figure. Workaround: clear S S.fig =...

대략 4년 전 | 0

| 수락됨

답변 있음
make matrix from other matrix ?
Maybe: row = [1,1,1,1,2,2,2,3]; s1 = max(row); s2 = numel(row); M = zeros(s1, s2); M(sub2ind([s1, s2], row, 1:s2)) = 1

대략 4년 전 | 0

답변 있음
Why this gives error?
LB = [0 0 0 0]; UB = [10 10 pi pi]; size(LB + rand * (UB - LB)) You cannot assign a [1 x 4] vector to the scalar particles_x(...

대략 4년 전 | 0

답변 있음
Operator '*' is not supported for operands of type 'cell'
Usethe debugger to analyse the problem. Either type dbstop if error and run the code again. If Matlab stops at the error, chec...

대략 4년 전 | 0

답변 있음
Store polyfit information of for loop in matrix
Maybe: n = floor(length(xorg) / 40) * 40; yp = zeros(n, 1); for j = 1:floor(length(xorg)/40) m = j * 40; yp(:, j) =...

대략 4년 전 | 0

답변 있음
How to programatically stop ode solver execution after fixed amount of computation time?
The Event function is a bad idea: If the specified time has come, ode45 tries to find the simulated t, when the event value has ...

대략 4년 전 | 1

| 수락됨

답변 있음
xmax is scalar floating function ?
See: https://www.mathworks.com/help/matlab/ref/integral2.html#btbbuxy-1-xmax integral2() expects the limits to be floating poi...

대략 4년 전 | 0

답변 있음
How to convert simple array to cell array with condition?
pop = [1 28 25 15 13 17 1 31 27 8 14 22 18 1 21 6 26 ... 11 16 23 10 19 1 7 4 3 24 29 12 9 1 2 32 20 5 30 1]; m = fin...

대략 4년 전 | 0

| 수락됨

답변 있음
what is the time complexity of function 'reshape'
In reshape the actual data are not touched, but only the vector of dimension. This vector is changed, so Matlab has to allocate ...

대략 4년 전 | 1

| 수락됨

답변 있음
How the image features are saved in .mat file?
You have 13 properties. The MAT file contains 2 fields. The first is called "label" and has 13 elements. I guess, you find the c...

대략 4년 전 | 0

답변 있음
How can convert the volume of a sound in matlab?
Multiplying a sound signal by 0.5 reduces the volume by 50%. If the volume should fade out from 100% to 60%: amp = linspace...

대략 4년 전 | 0

| 수락됨

답변 있음
How can I code this more effectively regarding running time?
It is hard to impossible to optimize code without having the complete code and the input. You have to guess too many details: A...

대략 4년 전 | 0

답변 있음
error in the code
You create a [7 x 16000] matrix and ask soundsc to play it. The error message is: Error using sound (line 76) Only one- and tw...

대략 4년 전 | 0

답변 있음
Array of integrals within loop
alpha = -1.0:0.1:1.0; for k = 1:numel(alpha) f = @(x) 1 ./ (x.^ 2 + 2 .* x * exp(alpha(k)) + 1); eq2(k) = integr...

대략 4년 전 | 1

답변 있음
How to reverse the operation?
A = [1 2 5 4 3]; B = [2 5 1]; AA = A; for i = 1:numel(B) AA([i, B(i)]) = AA([B(i), i]); end AA for i = numel(B):-1:1 ...

대략 4년 전 | 1

| 수락됨

답변 있음
How to write a for loop with d indexes
This is the code for 5 nested loops, but you set set d dynamically as you want: nLoop = 5; % Number of loops,...

대략 4년 전 | 0

| 수락됨

답변 있음
Moving Average Filter not working
Replace the output variable in the first line: function vectordata = filter_outlier_dwars(vectordata) % ==> function outlierl...

대략 4년 전 | 0

답변 있음
moving sum over multiple time windows
M1 = zeros(1, 100); for k = 1:100 M1(k) = max(movsum(Q, k, 'EndPoints','discard')); end

대략 4년 전 | 0

| 수락됨

답변 있음
music piece creation with matlab
You create the signal using sin() or cos() commands. 220Hz at 8000 Hz sampling frequency: F = 8000; t = linspace(0, 1, F); %...

대략 4년 전 | 0

답변 있음
How to save .fig Figure Background Color As Well As Saved Pict Format?
You can set this property during the creation of the figure: figure('InvertHardcopy', 'off'); Or dynamically later: set(gcf, ...

대략 4년 전 | 0

| 수락됨

답변 있음
Outputting information from a loop
What about: D = cat(2, Table2{:});

대략 4년 전 | 0

답변 있음
Normalized Sinc using matrix inputs
What about appending: y(isnan(y)) = 1;

대략 4년 전 | 0

답변 있음
Plot cummulative values without creating a cumulative vector with the values
This cannot work. To get the y value of the line, you do have to perform a cumulative sum. There is no chance to avoid this calc...

대략 4년 전 | 0

답변 있음
What am I doing wrong when returning the value from the function to my loop?
% C++: % while (int sent = dfs(s, t, INF)) sent = dfs(s, t, INF); while sent ~= 0 sent = dfs(s, t, Inf); end And: %...

대략 4년 전 | 1

| 수락됨

더 보기