필터 지우기
필터 지우기

Can anybody help me to solve this?

조회 수: 1 (최근 30일)
ASWATHI V
ASWATHI V 2018년 8월 15일
편집: ASWATHI V 2018년 8월 18일
When I am running this code it shows this error
Undefined function 'times' for input arguments of type 'function_handle'.
Error in withoutpt_fd1 (line 41)
A2 = 1-(a2_1.*a2_5);
a2_1 = lamda_su1*lamda_u1p*(phi_1*k*I)/(p_smax*lamda_u1u2);
a2_2 = @(z) exp((-lamda_u1p-((sig_2.*lamda_u1u2)/(k.*I))).*z);
a2_3 = @(z) z+((lamda_su1.*phi_1.*k.*I)./(p_smax.*lamda_u1u2));
a2_4 = @(z) a2_2(z).*a2_3(z);
a2_5 = @(z) integral(a2_4,0,Inf);
A2 = 1-(a2_1.*a2_5);

채택된 답변

ADragon
ADragon 2018년 8월 15일
Hi ASWATHI, when you call an anonymous function, you need to provide inputs just like a .m function. So, assignment A2 and a2_5 should be written as
a2_5 = @(z) integral(a2_4(z),0,Inf);
A2 = 1 - (a2-1(<z input>).*a2_5(<z input>));
You will need to replace "<z input>" with a numeric value or variable with a numeric values. Hope this helps
AD
  댓글 수: 4
ADragon
ADragon 2018년 8월 15일
I'm sorry. I see what you are doing... you are integrating a2_5 for z=0 to Inf. Modify a2_5 to the code below. a2_5 is not a function of z after you integrate. Everything else looks ok.
a2_5 = integral(a2_4,0,Inf);
The result should be the same as the solution provided by Star Strider.
ASWATHI V
ASWATHI V 2018년 8월 18일
편집: ASWATHI V 2018년 8월 18일
Thank you so much sir

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Argument Definitions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by