Answered
Help plss i always gets error message while running this code
The problem is in the first line already: syms Fab,Fad,Fbc,Fbd,Fcd,Fce,Fde,Ax,Ay,Ey; % ^ ^ ^ ^ ^ ^ ^ ^ ^ ...

4 years ago | 0

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

4 years ago | 0

Answered
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 years ago | 1

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 1

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

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

4 years ago | 0

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

4 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
Outputting information from a loop
What about: D = cat(2, Table2{:});

4 years ago | 0

Answered
Normalized Sinc using matrix inputs
What about appending: y(isnan(y)) = 1;

4 years ago | 0

Answered
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 years ago | 0

Load more