How do I plot YY from the excel file data?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I have data for different factors 1.4, 1.6 and 2.2. How do I plot YY for force reaction and keeping x-axis as displacement on the same chart? The pattern should be as shown in the figure but with yy plot so that the results are more visible.
Appreciate if anyone can assist me. Thank you!
채택된 답변
KSSV
2020년 5월 12일
data = xlsread("Sample Excel Data.xlsx") ;
A = data(:,[1 3 5]) ; % pick 1, 3 , 5 column
K = A(1,:) ; % factors
A(1,:) = [] ;
plot(A)
댓글 수: 14
Thanks for reply. Can you show a more comprehensive way of the plots that you get please? How about the plot yy? I am a beginner :)
Do you have any demo picture to show?
Refer the Capture.png image. But i need double y-axis.
What is displacement and force in the given data?
Refer the attached excel file. For each factor there is displacement and force values. I want to plotyy the force and plot the displacements on x-axis for all the factors 1.4,1.6 and 2.2 on same chart.
data = xlsread("Sample Excel Data.xlsx") ;
K = data(1,[1 3 5]) ; % factors
data(1,:) = [];
s1 = data(:,1) ; f1 = data(:,2) ;
s2 = data(:,3) ; f2 = data(:,4) ;
s3 = data(:,5) ; f3 = data(:,6) ;
plot(s1,f1,'r',s2,f2,'b',s3,f3,'g')
Thanks,It works. But, my question is, how do I set another y-axis on the right hand side? with a scale that I can change. Also, How do I change the plots to smooth plot with the points as shown in the picture?
figure
yyaxis left
plot(s1,f1)
yyaxis right
plot(s2,f2)
figure
yyaxis left
plot(s1,f1,'r')
plot(s3,f3,'g')
yyaxis right
plot(s2,f2,'b')
I can't plot s1 & f1 when I change the code like that? What should be done?
What do you mean by you cannot plot ?
It's okay I figured it out ready. Thank you for help.
data = xlsread("sampleexceldata.xlsx") ;
K = data(1,[1 3 5]) ; % factors
data(1,:) = [];
s1 = data(:,1) ; f1 = data(:,2) ;
s2 = data(:,3) ; f2 = data(:,4) ;
s3 = data(:,5) ; f3 = data(:,6) ;
figure
yyaxis right
plot(s3,f3,'g-*',s2,f2,'b-+')
axis ([0 5 0 90])
ylabel('Force (N)');
yyaxis left
plot(s1,f1,'r-x')
axis ([0 5 0 15])
grid on
title('Force vs Displacement');
xlabel('Displacement (mm)');
ylabel('Force (N)');
That is the line of code that I am using to plot that curve, can you assist me on how can i get scatter with smooth lines please? Note i renamed my excel file, thus the naming is different.
Hello, Can you assist in this please? I am still stuck.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
참고 항목
2020년 5월 12일
2020년 5월 16일
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
