Answered
"Index Exceeds Matrix Dimensions" Error Within ODE45 Events Function
The event function is called as [value,isterminal,direction] = myEventsFcn(t, y) The 2nd input is the current state vect...

9 years ago | 0

| accepted

Answered
Summing for loop speed-up by multiplication with unity.
My timings under R2015b/64/Win7: Elapsed time is 16.105212 seconds. % No "1*" Elapsed time is 16.074966 seconds. % With ...

9 years ago | 0

Answered
Error adding a line to an axes
Use the debugger to identify the problem: dbstop if error Now let the code run again. If it stops at the error, examine ...

9 years ago | 0

Answered
matlab Out of memory . Type HELP MEMORY for your options
A 20000*20000 matrix uses 3.2GB of RAM - not only free RAM, but this block must be available in one contiguous block. I do not k...

9 years ago | 0

Answered
How do I run a file automatically based on user file input?
Do you mean a <https://www.mathworks.com/help/matlab/ref/uigetfile.html |uigetfile|> dialog? See also: * <https://www.math...

9 years ago | 0

| accepted

Answered
Index exceeds matrix dimensions. Error in download (line 19) if ~exist(fullfile(output_directory, [regexprep(urls{i}(24, end), '/', '_')])) how to solve this type of error?
|urls{i}(24, end)| requires, that the contents of |urls{i}| has at least 24 rows. The error tells you, that this is not the case...

9 years ago | 1

Answered
How to modify a matrix to change the entries >=0 and multiply it by 5 AND to change the entries <0 and add 2 to those entries?
Start with "If an entry in B is greater than or equal to zero": You can either run a loop over all elements of B or use "logical...

9 years ago | 1

| accepted

Answered
Why do I recieve this message "Attempted to access x(43); index out of bounds because numel(x)=42." when I use the plot command?
I assume the problem is here: x = 'C:\Users\B50-70\Downloads\seven_nation.wav'; frame = 1024; X = zeros(frame...

9 years ago | 0

Answered
Is it possible to create a sub-array without using additional memory on Matlab?
Bruno Luong has implemented an inplace slice: See <https://www.mathworks.com/matlabcentral/fileexchange/23576-min-max-selection>...

9 years ago | 2

| accepted

Answered
set property of graphicsobject in array before R2014b
pos = get(handles.panel.children(4), 'Position'); pos(3) = some value; set(handles.panel.children(4), 'Position', pos); ...

9 years ago | 0

| accepted

Answered
How to compile standalone executables without using hardware accelerated graphics?
Maybe just insert this line in the code: opengl('software');

9 years ago | 0

Answered
Trying produce input to using while loops to create fibonacci sequence but i have done using the while and it is error.
What about this: lim = 10000; f(1) = 1; f(2) = 1; for i = 3 : 30 f(i) = f(i-1) + f(i-2); golden...

9 years ago | 0

Answered
How can I solve with Runge–Kutta method of order 5 on MatLab ?
See your other thread to the same problem <https://www.mathworks.com/matlabcentral/answers/370236-how-can-i-solve-a-system-of-od...

9 years ago | 0

Answered
Combine Strrep in one Line.
has = 'xy'; rep = 'zw'; [Lia, Locb] = ismember(a, has); a(Lia) = rep(Locb); [EDITED] I assume |strrep| has less ov...

9 years ago | 0

Answered
How can i get >=60% 1's and <=40% 0's in the code below?
Do you mean: pu = double(rand(1, 40) > 0.4) ? This gives approximately 60% 1s and the rest is 0s.

9 years ago | 0

Answered
get used lines project matlab
make mi live easier I would like to [...] unwrap all code to a only one script This would make the debugging much harder. It...

9 years ago | 1

| accepted

Answered
How do we calculate the dynamic time warping Matrix in Matlab ?
Perhaps by using 2 loops? What is "t" and "r" in your example? s2 = size(A, 2); for col1 = 1:s2 for col2 = col1+1:s...

9 years ago | 0

| accepted

Answered
Find positive elements in a 3D matrix
match = repmat(all(MR_ene > 0, 2), 1, 5, 1); MR_ene_pos = zeros(10000,5,19); MR_ene_pos(match) = ME_ene(match); UNT...

9 years ago | 0

Answered
How can I solve a system of ODE with a common variable ?
I assume than Pnm is not the sum of the 17 equations, but of the 17 components of the trajectory. Please show us, how Pnm is def...

9 years ago | 0

| accepted

Answered
Executing two timer functions continuously. GUI.
Using global variables is a bad idea in general. If you see a way to avoid them, do this. You did not mention, what is not wo...

9 years ago | 0

| accepted

Answered
Once more... Avoid global variable!
You can create a "global function" to store static parameters: function G = theGlobalData() G.pi = 3.14; G.imag = 1...

9 years ago | 2

| accepted

Answered
I wish to know how to automatically draw a constant current , each time the program runs.
Define the variables: Amp = [1,2,3,4,5] index = 0; Now call this code: index = index + 1; fprintf(eLOAD_ins...

9 years ago | 0

Answered
Unable to play the "audiowrite" file from the folder
It does not matter where the data are coming from. So let's narrow down the problem: Fd = 1600; new = 1 - 2 * rand(1, 3...

9 years ago | 0

Answered
How to loop shift a matrix for N times but keeping the result from each iteration?
H = zeros(R*M, T*M); for M = 0:7 idx = M * T + 1; H(:, idx : idx + T - 1) = circshift(H_dtelda, [R * M, T * M])...

9 years ago | 1

| accepted

Answered
I have following code, i want to perform following task on many images reading from directory. kindly help me through code.
See <https://www.mathworks.com/matlabcentral/answers/57446-faq-how-can-i-process-a-sequence-of-files> Simply replace I =...

9 years ago | 0

Answered
How do I replace my for loops using matrix manipulation?
The speed of your code depends on two points: # The speed of the function |ent()| # The number of times this function is cal...

9 years ago | 0

| accepted

Answered
Reactivate question to open new file?
If you do not find the corresponding checkbox in the preferences dialog (see Rik's comment), you can restore the previous versio...

9 years ago | 0

Answered
undefined unary operator ~ for input argumennts of type matlab.graphics.chart.primitive.line
The purpose of the line if ~handle.foundTargets(n).plotted is not clear. The error message tells, that |handle.foundTar...

9 years ago | 1

| accepted

Answered
How to break a for loop but run it one more time?
n = 20; stop = false; for k = 1:n ... your calculations are here fprintf('Execute %d\n', k); if stop ...

9 years ago | 0

Answered
I want to save a mat. file each time the program runs with a different name.
Folder = tempdir; % Define accordingly FileList = dir(fullfile(Folder, 'text*.mat')); NewFile = fullfile(Folder, sp...

9 years ago | 0

| accepted

Load more