How to extract values from tables in the workspace and then plot them in a specific way
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vladislav Mukhin
el 19 de Feb. de 2018
Comentada: Vladislav Mukhin
el 22 de Feb. de 2018
Hi everyone,
I am a relatively inexperienced user of MATLAB, so sorry if this is an obvious question.
Problem:
I have 3 16x8 tables in the workspace. Tables represent recordings from different conditions of muscle, and values in the tables are forces at specific point in muscle.
For example: row 1 column 1 values of Table 1 and Table 2 and Table 3 represent force in the same place in a muscle, just with different conditions. These conditions affect the force value in one way or the other.
I would like to plot these points in this way: Y-axis would be the force values, and X-axis value will be "20" for values taken from Table1, "30" for values from Table2, and "40" for values from Table3. So my output should be 16*8=128 scatter plots with 3 points in each.
Questions:
1. My first question would be how to plot values in this way? How do I set specific x-axis values opposing each row/column value from the table?
2. Answer to question 1 would allow me to do all of this "by hand", but how do I automate plotting these 128 scatter plots?
Thanks a lot!
2 comentarios
Peter Perkins
el 21 de Feb. de 2018
Vladislav, without meaning to tell you about your own data, this seems like a funny way to plot them. Have you considered making a 3-D scatter plot (force vs. x and y) with color to distinguish the three cases?
Or maybe 8 plots of force vs. X with symbols to distinguish the three cases?
Respuesta aceptada
Are Mjaavatten
el 20 de Feb. de 2018
Is this what you want?
x = [20,30,40];
for i = 1:16;
for j = 1:8;
figure;
plot(x,[Table1(i,j),Table2(i,j),Table3(i,j)],'*');
title(sprintf('i = %d, j = %d',i,j));
end
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!