how to plot different simulated data in one graph?

2 次查看(过去 30 天)
I wanted to run the following hypothesis based on power function. my three run consist of n=10,100 and 1000 and i want them to be on a single plot. can anyone help me out here. i know that hold will do this however, i will be losing my first run plot then.
*function vartest2_power;
nsimul=1000; % Number of repeated experiments
n=10; % Sample size
s=1+(0:0.1:1); % Values for the standard deviation of y
for i=1:length(s)
% Simulate x from a N(0,1) and y from a N(0,s) distribution
x=randn(n,nsimul);
y=s(i)*randn(n,nsimul);
for j=1:nsimul
h(j)=vartest2(x(:,j),y(:,j)); % Perform F-test
end
rejectrate(i)=sum(h==1)/nsimul; % Calculate rejection probability
end
plot(s,rejectrate)*

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2014-9-25
use hold on

标签

Community Treasure Hunt

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

Start Hunting!

Translated by