필터 지우기
필터 지우기

Markowitz matlabe code problem

조회 수: 3 (최근 30일)
Luan Vardari
Luan Vardari 2018년 9월 13일
편집: Luan Vardari 2018년 9월 14일
I have a problem with QUADPROG, who can help with this. Below is code, when i run code have same error (Error using quadprog (line 144) QUADPROG requires the following inputs to be of data type double: 'X0'.).
  댓글 수: 1
motleyfool
motleyfool 2018년 9월 14일
Can you upload ur code and data?

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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 9월 14일
You have
quadprog(P1Cov,c,Aineq,-r(i),beq,lb,ub,x0,options)
the syntax with 9 parameters is
quadprog(H,f,A,b,Aeq,beq,LB,UB,X0)
Matching, we see that you are passing in:
  1. P1Cov for the H parameter
  2. c for the f parameter
  3. Aineq for the A parameter
  4. -r(i) for the b parameter
  5. beq for the Aeq parameter -- that does not look right
  6. lb for the beq parameter -- that does not look right
  7. ub for the LB parameter -- that does not look right
  8. x0 for the UB parameter -- that does not look right
  9. options for the X0 parameter -- that does not look right, and is triggering the error message
It looks to me as if you have failed to pass the Aeq parameter.

카테고리

Help CenterFile Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by