Answered
how do I make a for loop
You are mixing the values of the former step, the current step and the vector of outputs. Without clear comments or an exhaustiv...

3 dagen ago | 0

Answered
Monitor key press while editing text description in figure
This is not possible with the 'Editing=on' method. Use an edit field instead.

5 dagen ago | 1

Answered
Rename multiple files in consecutive order
Do the 22 folders have a common base folder? If so: SrcFolder = 'C:\Your\Base\Folder\'; % Parent folder of the 22 folders De...

5 dagen ago | 0

Answered
Importing a "Large (2.5GB)" TIFF file with 'imread' function
The error message means, that filename is a char vector. Then the index {1} would work with a cell string, which would be replie...

5 dagen ago | 1

Answered
Gaussian elimination using a system of equations, Ax=b
Replace c(t1-d) by c * (t1-d)

5 dagen ago | 0

| accepted

Answered
Every 1,5,9,13..... marker point should be of same color. Similarly 2,6,10...... and 3,7,11...... and 4,9,12.... should be of same color
x = 1:100; y = rand(1, 100); colorPool = [1,0,0; 0,1,0; 0,0,1; 1,0,1]; figure; axes('NextPlot', 'add'); % Equivalently to...

7 dagen ago | 0

Answered
mass spring inpulse ode45
Your function to be integrated replies a function handle instead of a numerical vector in some cases: if Forza_spingente(t)>fes...

7 dagen ago | 0

Answered
Setting lone 1s to 0s in a logical vector/matrix
With FEX: RunLength : a = [0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0]; [val, n] = RunLength(a); del...

8 dagen ago | 0

Answered
Removing subfolders with same name
BaseFolder = 'C:\Parent\Folder' List = dir(fullfile(BaseFolder, '**', 'Folder B')); List = List([List.isdir]); List(strcmp({L...

8 dagen ago | 0

| accepted

Answered
Rename files with same name as parent folder
Do the folders "Folder A", "Folder B", ... have the same parent folder? Is there a pattern to recognize "File 1"? The simplifica...

8 dagen ago | 0

| accepted

Answered
How can I optimize this recursive for loop?
tic Tmax = 1e2;% which I want to increase by 1 order of magnitude dt = 1e-2;% which I want to decrease by 1 order of magnitude...

8 dagen ago | 0

Answered
How can I fix this? Warning: Data clipped when writing file. > In audiowrite>clipInputData (line 407) In audiowrite (line 187) In generator (line 100)
You can normalize the data such, that the values are in th allowed range [-1 +1]: dtmf_output = dtmf_output ./ max(abs(dtmf_out...

8 dagen ago | 0

Answered
Loading files with different names in MatLab
Do you want to load all files inside a folder? Folder = 'C:/Users/M/Datasets'; FileList = dir(fullfile(Folder, '*.vhdr')); ...

8 dagen ago | 0

Answered
Issue in using p file
You cannot use an outdated P-file in a modern Matlab version. Either download an old Matlab version and run the code there. Or ...

10 dagen ago | 1

Answered
ContextMenu for each ListBoxItem
For the Java based listboxes in figures (not uifigures), see: https://undocumentedmatlab.com/articles/setting-listbox-mouse-acti...

10 dagen ago | 0

Answered
How to calculate the result correctly?
You show us a formula, which calculates a negative value and explain, that the result should be positive. The argument, that a s...

10 dagen ago | 0

Answered
How to add values to matrix in a loop given an extra condition.
A = [1 -2; ... 3 3; ... 4 -5 ]; A2 = zeros(size(A, 1), 1); % Pre-allocate maximum number of elements iA2 =...

10 dagen ago | 0

| accepted

Answered
Appending of matrix columns
This is a basic question. In is more efficient to learn the fundamental basics from Matlab's Onramp or from the Getting Started ...

10 dagen ago | 0

Answered
Is it possible to vectorize this simple recursive function in loop?
No, this cannot be vectorized. The idea of vectorization is that the same function is applied to many arguments independently f...

10 dagen ago | 1

| accepted

Answered
facing issue to show images from folder.
Use the debugger to find the cause of errors. Type this in the command window: dbstop if error Then run the code again. When M...

11 dagen ago | 0

Answered
How do I put arrays into a for loop
Hiding an index in the name of a set of variables is the main problem here. This makes it hard to access the variables. Use an i...

11 dagen ago | 1

Answered
How to transpose cell arrays within a larger cell array
"The dynamics file is a {1x3} cell and embedded within this are another set of {3x1} cells with uniform matrices." - What are "u...

11 dagen ago | 0

| accepted

Answered
How to stop execution of a program through code?
tic; while toc < 120 figure; axes; plot(1:1000, rand(1, 1000)); pause(0.5); delete(gcf); end Or equ...

11 dagen ago | 1

| accepted

Answered
Error using reshape (Size arguments must be real integers)
This is not meaningful: V_final=[101010100010000010001000000000] Do you mean this: V_final=[1,0,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1...

11 dagen ago | 0

| accepted

Answered
Problems with reading a .txt file in Matlab
The format of the text file is not trivial. Some headers and data sections occur and without having the exact definition it is n...

11 dagen ago | 0

Answered
java heap error when opening txt file
"I think 820MB shouldn't be too large" What is the purpose to open a 820MB file in Matlab's editor? What do you want to do with...

11 dagen ago | 0

| accepted

Answered
How can I make a table bisection method and put all iterables step by step?
With your current method the table is overwritten in each iteration. Create the table before the loop and insert the new values ...

11 dagen ago | 0

| accepted

Answered
How to resolve this below error
The error message tells all known details already. COM4 is not available. Other ports are not availaible also. Matlab suggests t...

12 dagen ago | 1

Answered
cant open .fig anymore
Use the debugger to find the reason of the problem. Type this in the command window: dbstop if error Then run the code again. ...

12 dagen ago | 0

| accepted

Answered
find and plot in a x-y graph the pixels allong the red line
See: doc improfile

12 dagen ago | 1

| accepted

Load more