필터 지우기
필터 지우기

multiple lines+ P-value

조회 수: 6 (최근 30일)
Brave A
Brave A 2019년 4월 14일
댓글: Brave A 2019년 4월 17일
Hi there I have 2 languages to compare speed between them.
and I need to
1- plot 4 lines as my Y axis. and then for X axis I need every line in y related to the name in X axis.
2- add P- value to calculate it.
Here is my attempt thanls in advance for help and any suggestions are welcome in how to represent the data in a good way!
y1 = importdata('Crow700.txt');
figure
plot(y1)
hold on
set(gca,'xticklabel',x1.')
y2 = importdata('Ccol700.txt');
set(gca,'XTickLabel',{'Partial Row in C','Partial Column in C','Partial Row in Java', 'Partial Column in Java'})
plot(y2)
y3 = importdata('Javacol700.txt');
plot(y3)
y4 = importdata('Java700.txt');
plot(y4)
tt.jpg
I need like this figure.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 4월 15일
You define your third xticklabel as partial row in java, but the filename you use talks about columns.
The same diagram talks about size of matrix, but your filenames suggest that you have a fixed size matrix of 700. But it is not obvious what the various entries in any one file will correspond to.
What is your x axis for your plot? Your xticklabel suggest that you have 4 x values per plot, one for each of the languages, but your file names suggest each contains data only for one language.
I would speculate that your xticklabels should not be tick labels at all. I speculate that what you want with those entries is to legend() them.
Brave A
Brave A 2019년 4월 15일
I missed my code I know that :(
would you please fix the code as you suggest.
Thanks in advance!

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 4월 15일
y1 = importdata('Crow700.txt');
y2 = importdata('Ccol700.txt');
y3 = importdata('Javacol700.txt');
y4 = importdata('Java700.txt');
plot(1:length(y1), y1, 'k->', 1:length(y2), y2, 'k--v', 1:length(y3), y3, 'b->', 1:length(y4), y4, 'b--v')
legend({'Partial Row in C','Partial Column in C','Partial Row in Java', 'Partial Column in Java'})
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 4월 15일
"p-value" normally refers to a probability. I do not see any probability calculations in your code.
Brave A
Brave A 2019년 4월 17일
Sorry for inconvince issue .
I fixed the code and post it here.
thanks in advance

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by