Determine if an array has any elements that are zero ?

조회 수: 37 (최근 30일)
zk1998
zk1998 2019년 3월 17일
편집: dpb 2019년 3월 17일
Hello I am trying to write a function file that will take a row vector representing a polynomial and return a 0 if it at least one of the coefficents of the polynomail is zero and a 1 if otherwise.
Many thanks in advance.

채택된 답변

dpb
dpb 2019년 3월 17일
편집: dpb 2019년 3월 17일
function flg = isFullPoly(b)
% isFullPoly(b) returns T if all coefficients, b, nonzero, F otherwise
flg=all(b);
end
This one really doesn't need a function for other than "syntactic sugar" to indicate what are testing which a comment could do as well...but, nothing really wrong with doing so if wish...

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by