Borrar filtros
Borrar filtros

how to plot different simulated data in one graph?

2 visualizaciones (últimos 30 días)
Hydro
Hydro el 25 de Sept. de 2014
Respondida: Azzi Abdelmalek el 25 de Sept. de 2014
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)*

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 25 de Sept. de 2014
use hold on

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by