Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How do i modify the code when a=0,a=0.1,...,a=0.9,a=1
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to calculate the Ps when a=0.1,a=0.2,....,a=0.9,a=1.0 , so i think i should have 11 different Ps number,however,the window always show me 11 same number,it seems that it just calculate 11 times when the "a" is the same number.
How do i modify my code?
a=0:0.1:1
B=[1;2;3;4;5;6]
C=[7;8;9;10;11;12]
gN=1;
for i=1:1:length(a)
f_A=( a(i)*B+(1-a(i))*C)/norm( (a(i)*B+(1-a(i))*C) );
PsB=abs((gN)/(f_A'*f_A));
PsC=abs((gN)/(f_A'*f_A));
if PsB > PsC
Ps(i)=PsB
else
Ps(i)=PsC
end
end
The window show me
Ps =
Columns 1 through 5
1.0000 1.0000 1.0000 1.0000 1.0000
Columns 6 through 10
1.0000 1.0000 1.0000 1.0000 1.0000
Column 11
1.0000
1 comentario
Ankit
el 2 de Oct. de 2019
it should be the same number
PsB = num/den , your num is 1 and product of f_A'*f_A is also 1.
What i dont understand size of your variable a is 11, B & C is 6.
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!