How to extract values from tables in the workspace and then plot them in a specific way
조회 수: 7 (최근 30일)
이전 댓글 표시
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
Peter Perkins
2018년 2월 21일
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?
채택된 답변
Are Mjaavatten
2018년 2월 20일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!