Using Solve with 'albersheim'
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Vijay Bambal
el 7 de En. de 2019
Comentada: Vijay Bambal
el 7 de En. de 2019
I am trying to find Probability of detection (Pd) given SNR and Pfa with function 'albershiem; given values of SNR and Pfa. The code goes as under :-
syms Pd;
Pfa = 7e-10;
SNR = 14;
eqn = SNR == albersheim(Pd, Pfa);
At this stage error 'Pd expected to be numeric. Instead its type was sym' is indicated.
So the next statement soln = solve(eqn, Pd) cannot even be executed.
Request assistance.
1 comentario
Walter Roberson
el 7 de En. de 2019
Not all functions are written with symbolic values in mind. Looking at the code it appears to me that the way the code was written to permit efficient code generation is inconsistent with the possibility of symbolic input. That is it appears to me that if you were to copy the routine and strip out the error checking that you could arrive at something that could take symbolic inputs, that the problem is not the algorithm but rather the hooks and checking for code generation .
Looking at the calculation I would suspect there will not be a closed form solution for solve to find. solve would probably return a numeric solution .
Respuesta aceptada
Torsten
el 7 de En. de 2019
Pfa = 7e-10;
SNR = 14;
Pd0 = 1.0;
Pd = fzero(@(x)albersheim(x,Pfa)-SNR,Pd0);
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!