Error using sym/subsindex , Error in sym/subsref

조회 수: 4 (최근 30일)
Ege Alp TURKYENER
Ege Alp TURKYENER 2020년 5월 15일
답변: Ameer Hamza 2020년 5월 15일
syms Ybus k n V i N;
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Error using sym/subsindex (line 855)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym
expression.
Error in sym/subsref (line 900)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in hmw (line 28)
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Where is the problem ?

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 5월 15일
You are using Ybus, S, and V as functions, however, you defined them as simple symbolic variables. Try this
syms Ybus(k,n) V(k,i) N S(k)
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Also, here you are defining V(k,i) in terms of V(k,1). It appears there might be a logical error. Can you show the equation you are trying to implement?

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by