Hi Nicolas,
I understand that you want the same column number in two different matrices be plotted on a figure and then in the next iteration take the data points from the next column in both the matrices and plot them on the same figure?
The loop can be removed when working with PLOT function in MATLAB. PLOT can take matrices as an input argument. More information on the PLOT function can be found in the documentation link below:
Scenario 1: Use PLOT function and plot lines:
A = rand(9,5);
B = rand(9,5);
figure;
plot(A,B);
SCATTER function unfortunately does not take matrices as an input argument. So there is no way to remove the loop. More information on SACTTER function can be found in the documentation link below:
But in this case we can specify markers in PLOT function to get the same result:
Scenario 2: Use PLOT function with Markers
A = rand(9,5);
B = rand(9,5);
figure;
plot(A,B,'o');
Hope this helps!
Thanks
Sudhanshu Bhatt