필터 지우기
필터 지우기

Apply conditions in if statement.

조회 수: 8 (최근 30일)
Silpa K
Silpa K 2019년 10월 13일
댓글: Shivam Prasad 2019년 10월 16일
A = [];
for ii = 1:length(subSequence)
if any(ismember(subSequence{ii},out)) && mod(k-midpoint)<=G+l/2
A{end+1} = subSequence{ii};
end
end
Iam getting errors when Iam using the second condition 'mod(k-midpoint)<=G+l/2'.
The error is like:
Error using mod
Not enough input arguments.
Error in Facetra (line 38)
if any(ismember(subSequence{ii},out)) && mod(k-midpoint)<=G+l/2
How can I avoid this errors.
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 10월 13일
You appear to be wanting to use a different function named mod than the Mathworks function, which is the mathematical Modulo (remainder) operator. The mathematical Modulo operator always has two parameters: the value whose remainder is to be found, and the base with respect to which the remainder is to be found. For example, mod(7,3) asks to find the remainder with respect to division by 3 for the number 7.
You will need to locate source code or implementing library for whatever the function named mod does, and add that to your MATLAB path earlier than the MATLAB mathematics libraries.
If at all possible you should rename that third-party mod function, as otherwise it is very likely you will run into conflicts with the mathematical Modulo operator.
Shivam Prasad
Shivam Prasad 2019년 10월 16일
Hi Silpa,
Can you let me know what are you trying to do in these lines of code? Maybe you require a different function to implement the operation.
The mod function defined as mod(a,b) implements the mathematical operation a%b, which is the remainder when a is divided by b.
More on mod function :-

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by