How to plot more than 1 curves in one graph.

2 ビュー (過去 30 日間)
Danilo Ambrosio
Danilo Ambrosio 2017 年 12 月 15 日
回答済み: KL 2017 年 12 月 15 日
Hi everybody!
I am trying to treat some data obtained making tensile tests. I would like to compare some curves between different specimens' family but I don't know how to do it. The principle problem is that I don't know how I can read all the excel of the test that I wanna plot together and then I will need some advice to plot all the data together.
Thanks in advance.

回答 (1 件)

KL
KL 2017 年 12 月 15 日
if they are in columns of excel, read it as a matrix (for a all-numeric matrix),
data = xlsread(filename);
now let's say you have 5 columns with columns 2-4 being the interested thing for you. Then simply,
f = figure;
h = plot(data(:,2:4))
to differentiate lines you can add legends,
legends('line1','line2','line3','last line')

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by