Hi!
If I understand your question correctly, you would like to parallelize working with each value from MyVariable, i.e. turn your most outer loop (for i=1:length(MyVariable)) into a parfor. I do not see any issues with that, as each iteration of that loop is independent (operates with and changes its own set of variables like Table). For examples of possible issues and fixes for them you can refer to this documentation page: https://www.mathworks.com/help/distcomp/nested-parfor-loops-and-for-loops.html
I would also be careful with your most inner loop (over rows of Table meeting a certain condition). It looks like you are looping over the rows of the Table while also removing rows from the Table. Consider the following example, where we try to remove every other row of A:
A = randn(10, 5);
for k=2:2:10
k
A(k,:) = [];
end
With this for loop we will run into index out of range problem (while also deleting the wrong rows, as the indices would shift as we remove rows). Instead we can accomplish the task like this:
A = randn(10, 5);
k=2:2:10;
A(k,:) = [];
I hope this helps!
Kris