how to plot different simulated data in one graph?

3 views (last 30 days)
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)*

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 25 Sep 2014
use hold on

Tags

Community Treasure Hunt

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

Start Hunting!