How do I plot YY from the excel file data?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
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 :)
KSSV
2020 年 5 月 13 日
Do you have any demo picture to show?
Refer the Capture.png image. But i need double y-axis.
KSSV
2020 年 5 月 13 日
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.
KSSV
2020 年 5 月 13 日
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?
KSSV
2020 年 5 月 13 日
figure
yyaxis left
plot(s1,f1)
yyaxis right
plot(s2,f2)
Ashvinder Singh Gill Surmaish Singh Gill
2020 年 5 月 13 日
編集済み: Ashvinder Singh Gill Surmaish Singh Gill
2020 年 5 月 13 日
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?
KSSV
2020 年 5 月 13 日
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)');
Ashvinder Singh Gill Surmaish Singh Gill
2020 年 5 月 13 日
編集済み: Ashvinder Singh Gill Surmaish Singh Gill
2020 年 5 月 13 日
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!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)
