Answered
how to vectorize this for loops?
Neither the inner nor the outer loop can be vectorized. The two |imshow| commands are impossible to vectorize. Do you really nee...

9 years ago | 1

Answered
CSV Input date format
The seconds are lower case 'ss', the fractional seconds uppercase 'SSS': formatIn = 'MM/dd/yyyy HH:mm:ss,SSS' See the ...

9 years ago | 0

| accepted

Answered
How do I solve the Classpath.txt problem?
May re-installing Matlab helps. At least this thread <https://www.mathworks.com/matlabcentral/answers/300027-cannot-start-matlab...

9 years ago | 0

Answered
Assign a 'double' variable to struct
A.b = 'example'; A.b = struct('c', 2); % Overwrite field "b" Or: A.b = 'example'; A.b = []; A.b.c = 2 ...

9 years ago | 0

| accepted

Answered
i need dll file mclmcrrt75.dll
Did you search in the forum or the net already? You would find e.g.: * <https://www.mathworks.com/matlabcentral/answers/9429...

9 years ago | 0

Answered
Aggregation by index in first column
Maybe you want: [uDay, ~, iU] = unqiue(days, 'rows'); Result = splitapply(@sum, consump, iU);

9 years ago | 0

| accepted

Answered
Extraction of a sub matrix from a mother matrix
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength>: A = [0 0 1 1 0 0 0 1 1 1 1 1 0 ...

9 years ago | 0

| accepted

Answered
How to solve this error: Error using reshape To RESHAPE the number of elements must not change.
The message means, that C{1} does not have 2304*3589*2 elements. Because we do not have your input file, we cannot check this. B...

9 years ago | 0

Answered
Finding cell array row indices based on numeric column values
The cell is not useful for these comparisons. Converting is to a table is the next indirection. Easier: % Store strings in ...

9 years ago | 0

Answered
Hi guys.could you help me please?
The conversion to a char vector by |sprintf| or |num2str| is short an easy sometimes, but internally a lot of computations are r...

9 years ago | 1

Answered
How to reduce execution time of for loops in MATLAB?
s100 = size(re_bin,1) / 100; % Pre-allocate: encodedData = zeros(s100, 0); % Better define 2nd dimension correctly f...

9 years ago | 0

| accepted

Answered
How to represent waveform (sum of sinusoids) in complex notation
What about: y(f,:) = cos(2*pi .* f .* dt + random_phase) + ... 1i * sin(2*pi .* f .* dt + random_phase); O...

9 years ago | 0

| accepted

Answered
for loop help needed
Do not create a set of variables. See <https://www.mathworks.com/matlabcentral/answers/57445-faq-how-can-i-create-variables-a1-a...

9 years ago | 0

| accepted

Answered
How can i change a binary message of type double (1000101000111001000100) into type char ('1000101000111001000100') so in between ' '?
I guess, that you mean: d = [1,0,0,0,1,0,1,0,0,0,1,1,1,0,0,1,0,0,0,1,0,0] and want to convert it to a char: s = spr...

9 years ago | 2

Answered
How to get permission to publish my MATLAB programs?
"ResarchGate" means a scientific application. I'd expect that you need an standard, education or student version for publishing ...

9 years ago | 0

Answered
How to find the inflections points in noisy, variable data cycles?
If the slopes are mot important, use |gradient(signal)| as input for |findpeaks|.

9 years ago | 0

Answered
Plotting a Step Function
What about this: t = [q*T, (q + x) * T, (q + x) * T, (q + 1) * T]; % [EDITED, Typo fixed] y = [1, 1, 0, 0]; plot(t, ...

9 years ago | 0

Answered
Finding Sequences of 1's values
And for completeness a C-Mex function also: <https://de.mathworks.com/matlabcentral/fileexchange/41813-runlength> [B, N] = ...

9 years ago | 0

Answered
How can I find run length consecutive ones and zeros and their occurrence times in a binary sequence in MATLAB?
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength>: s = [1 1 0 0 0 0 0 1 1 1 1...

9 years ago | 4

Answered
Selecting lines from plot
E.g.: handles.P(1) = line(handles.Plot1, 'XData', chunktime, 'YData', normChunk1); handles.P(2) = line(handles.Plot1, 'X...

9 years ago | 0

| accepted

Answered
How to create a 3D array with matrices of unequal dimentions
No, a 3D array must have the same number of rows and columns for all pages. Use a cell array instead: tjdf = cell(1, length...

9 years ago | 1

| accepted

Answered
if statement not working
"If the Xnew is negative the answer for X should also be negative" As code considering that |a| could be negative also: ...

9 years ago | 0

Answered
Storing the output of a for loop in a cell array
Maybe: x = [0,0,0,0,0,5,6,4,3,4,5,6,3,3,5,5,6,3,0,4,4,5,4,4,9,9,0,223,32,4,0,0,0,1]; Branch = cell(numel(x), 1); %...

9 years ago | 0

Answered
How can I find the number of times a value in an 'time series input' is repeated at least 100 times or more?
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength FEX: RunLength> : [B, N, Index] = RunLength(Sign...

9 years ago | 0

Answered
Finding signal "lag" on y axes
What about: yShift = mean(s2) - mean(s1)

9 years ago | 0

Answered
How to mix two sound of different channel?
Insert some meaningful comments in your code, such that it gets clear, what you want to achieve. I assume, you want to mix the 2...

9 years ago | 0

Answered
replace spaces in a string
With <https://www.mathworks.com/matlabcentral/fileexchange/41813-runlength>: s = 'a a a a b bcd a '; [B, ...

9 years ago | 0

Answered
for loop with exceptions
for even = 2:2:26 if even ~= 4 disp(even) end end Or index = 2:2:26; index(index == 4) = []; ...

9 years ago | 0

Answered
combining matrices by replacing zeros
A = [1 ,0, 2, 0, 3, 0, 5]; B = [0, 2, 0, 3, 0, 5, 0]; C = A + B Or if the zeros need not be at the same indices as th...

9 years ago | 0

| accepted

Answered
Is a HP Pavilion x360 suitable for MATLAB
I do not like product placements in the forum. This is near to be a commercial. Instead of advertising the machines name, it wou...

9 years ago | 0

| accepted

Load more