How to plot figure for multiple values

Hi all
I have 15 numbers.mat files , I calculate the max ,mean and min for each one.
My question is how to plot the max,mean and min as the figure below?

6 件のコメント

José-Luis
José-Luis 2014 年 9 月 9 日
What have you tried so far? The documentation for plot() will take you a long way;
doc plot
israa
israa 2014 年 9 月 9 日
let say i have a.mat with a-max ,a-mean and a-min, and another b.mat with b-max, b-mean and b-min.
How to plot a-max and b-max as one vector?
plot a-mean and b-mean as one vector?
plot a-min and b-min as one vector?
and then plot all those three vectors in one figure with those circles and dotes
José-Luis
José-Luis 2014 年 9 月 9 日
Have you read the documentation?
israa
israa 2014 年 9 月 9 日
Ok to put all vectors in one figure i should use hold, but how to make these vectors? the documentation used sin wave as a vector
José-Luis
José-Luis 2014 年 9 月 9 日
data = rand(10,3);
plot(data);
israa
israa 2014 年 9 月 9 日
i dont need any numbers i have a specific values..anyway thanks for you

サインインしてコメントする。

 採用された回答

israa
israa 2014 年 9 月 10 日

1 投票

My friend solved it for me.. Assume that the 15 (number.mat files) are all in the MATLAB path and all have the same length (for example 100 values in each number.mat)
number_v(1:100,15)=zeros; %create vector with all number.mat files
for i=1:15 %loop for import data from current MATLAB path
v=sprintf('number%d.mat',i);
number=importdata(v);
number_v(:,i)=number(1:100,:);
end
min_v=min(number_v); % min vector
max_v=max(number_v); % max vector
mean_v=mean(number_v); % mean vector
plot(min_v,'r --o','LineWidth',2) % plotting with properties
hold on % keep holding the same figure
plot(max_v,'k --*','LineWidth',2)
plot(mean_v,'--p','LineWidth',2)
hold off
So thanks for him ^_^

その他の回答 (1 件)

Andrew Reibold
Andrew Reibold 2014 年 9 月 9 日

1 投票

When a figure is open, use
hold on
before plotting to keep putting more plots on the same figure

カテゴリ

質問済み:

2014 年 9 月 9 日

回答済み:

2014 年 9 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by