I'm new to Matlab, I defined the following functions:
function L1 = Like1(y)P0 = 1/(2*pi*0.6)*exp(-1/(2*0.36)*(x^2+y^2-2*0.8*x*y));P1 = 1/(2*pi*1)*exp(-1/(2*1)*(x^2+y^2));L1 = int(P1,x,-inf,0)/int(P0,x,-inf,0);endfunction L2 = Like2(y)P0 = 1/(2*pi*0.6)*exp(-1/(2*0.36)*(x^2+y^2-2*0.8*x*y));P1 = 1/(2*pi*1)*exp(-1/(2*1)*(x^2+y^2));L2 = int(P1,x,0,+inf)/int(P1,x,0,+inf);endfunction I1 = Int1(y)P0 = 1/(2*pi*0.6)*exp(-1/(2*0.36)*(x^2+y^2-2*0.8*x*y));I1 = int(P0,x,-inf,0);endfunction I2 = Int2(y)P0 = 1/(2*pi*0.6)*exp(-1/(2*0.36)*(x^2+y^2-2*0.8*x*y));I2 = int(P0,x,0,+inf);endfunction I3 = Int3(y)P1 = 1/(2*pi*1)*exp(-1/(2*1)*(x^2+y^2));I1 = int(P1,x,-inf,0);endfunction I4 = Int4(y)P1 = 1/(2*pi*1)*exp(-1/(2*1)*(x^2+y^2));I2 = int(P1,x,0,+inf);end
and I'm trying to plot the following two functions:
function alpha = error1(T)syms y; alpha = int(Int1(y),y,solve(Like1(y)>T,y))+ int(Int2(y),y,solve(Like2(y)>T,y));endfunction beta = error2(T) syms y;beta = int(Int3(y),y,solve(Like1(y)<T)) + int(Int4(y),y,solve(Like2(y)<T))end
I have 2 questions , when I run this function editer, I keep getting the error "Undefined function or variable 'T'".
Once I solve this issue, what would be the next step to plot error2(T) vs. error1(T).
Best Answer