How to evaluate a function?

1 次查看(过去 30 天)
Max
Max 2016-2-9
编辑: Stephen23 2016-2-9
Hello,
I would like to find values for three parameters that satisfy the following equation: R>=value (e.g.2)
R is the likelihood-ratio: L/L_LK
This is my source-code:
1a = [3850,4340,4760];
2a = [3300,3720,4080];
3a = [2750,3100,3400];
beta_hat =13.502152;
B_hat = 1861.328876;
C_hat=39.624407;
syms B C beta positive
L=1;
for j=1:length(1a)
L=L*((beta/(C*exp(B/393)))*((data_test_1a(j)/(C*exp(B/393)))^(beta-1))*exp(-((data_test_1a(j)/(C*exp(B/393)))^beta))*(beta/(C*exp(B/408)))*((data_test_2a(j)/(C*exp(B/408)))^(beta-1))*exp(-((data_test_2a(j)/(C*exp(B/408)))^beta))*(beta/(C*exp(B/423)))*((data_test_3a(j)/(C*exp(B/423)))^(beta-1))*exp(-((data_test_3a(j)/(C*exp(B/423)))^beta)));
end
L_LK= double(subs(L,[B,C,beta],[1861.328876,39.624407,13.502152]));
R=L/L_LK;
One possibility to do that is to hold two parameters constant and vary the 3rd one and so on.
But I don´t really know how to realize it in matlab.
Does somebody have an idea? Thanks in advance for all solutions.

回答(1 个)

Explorer
Explorer 2016-2-9
1a = [3850,4340,4760]
It's a row vector and you can't name a row with "1a". Yes, you use a1.
So replace 1a with a1, 2a with a2 and 3a with a3.
  3 个评论
Explorer
Explorer 2016-2-9
编辑:Explorer 2016-2-9
You welcome. If I have answered your question, please accept my answer.
Max
Max 2016-2-9
Unfortunately, that´s not the answer.Sorry.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by