How do I correct a parse phase error at both function and end?

1 回表示 (過去 30 日間)
Mykaela Quinn
Mykaela Quinn 2021 年 2 月 25 日
回答済み: Anshika Chaurasia 2021 年 3 月 2 日
sysm I1 I2 I3;
function
eqn1=I1+I2-I3==0;
eqn2=-I1(2,000)-I3(1,500)+5==0;
eqn3=-I2(3,00)-I3(1,500)+5==0
sol=solve([eqn1.eqn2.eqn3],[I1,I2,I3]);
I1Sol=sol.I1;
I2Sol=sol.I2;
I3Sol=sol.I3;
end

回答 (1 件)

Anshika Chaurasia
Anshika Chaurasia 2021 年 3 月 2 日
Hi Mykaela,
You are getting parse error because you haven't declare function properly. Refer to function documentation for declaring your function properly.
One more correction in your code, replace sysm with syms. Refer to syms documentation.
Hope it helps!

カテゴリ

Help Center および File ExchangeLabels and Annotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by