Hi @Kyle Koutonen, it is my understanding, that you have created a table in the app designer, and you want to filter the table and delete the rows that are over a selected value. However, the loop you have written deletes only the last row and not all the required rows.
Upon investigation of the code, the issue seems to be that "k" is not being incremented in the for loop. This results in only the last row index being stored in "rowsdelt". Also, the variable "rowsdelt" needs to be initialized properly before the “for loop” to store the values.
Here is the updated MATLAB code with changes:
Filter = app.CutOffValueEditField.Value;
n = size(app.t, 1);
k = 1;
rowsdelt = []; % Initialize rowsdelt as an empty array
if app.LowPassButton.Value
for i = 1:n
if app.UITable3.Data(i, app.ColumnNumberbeingevalulatedEditField.Value) >= Filter
rowsdelt(1, k) = i; % Store the index of the row to delete
k = k + 1; % Increment k to store the next row index
end
end
app.UITable3.Data(rowsdelt, :) = [];
end
I hope this resolves the issue.