Calling multiple .m files into separate function

1 回表示 (過去 30 日間)
Mughees Asif
Mughees Asif 2019 年 3 月 19 日
コメント済み: Walter Roberson 2019 年 3 月 19 日
function [B, H] = IsStable(polynomial)
if polynomial ~= AllNonZero(polynomial(false))
B=0;
H=[];
elseif polynomial ~= AllSameSign(polynomial(false))
B=0;
H=[];
else
H=HurwitzMatrix(polynomial);
pm = length(H);
for i=1:pm
minor(i)=det(polynomial(1:i,1:i));
end
if minor(i)>0
B=1;
else
B=0;
end
end
I am trying to calculate the stability of a Hurwitz Matrix by checking if the principle minors are more than zero. Any sugestions to improve the above code as it is not working when I call three separate .m files e.g. AllNonZero, AllSameSign and HurwitzMatrix? Thank you.
  7 件のコメント
Adam
Adam 2019 年 3 月 19 日
So, as Walter asked, what are you passing in as the parameter?
Walter Roberson
Walter Roberson 2019 年 3 月 19 日
If AllNonZero is false then isn't the matrix all 0 or at least a row of 0?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStability Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by