simulink error:Class mismatch for variable 'exist'. Expected 'logical', Actual 'double'.
조회 수: 8 (최근 30일)
이전 댓글 표시
I get a error in a MATLAB function block
coder.extrinsic('exist');
N=1296;
if exist('w_1','var')
W1=w_1;
else
W1=zeros(N,1);
end
댓글 수: 0
답변 (1개)
chengxuan yu
2018년 4월 1일
편집: Walter Roberson
2018년 4월 1일
Because 'exist' return a double value and 'if' need to follow a logical value.
you can modify the code like this:
if isequal(exist('w_1','var'),1)
W1=w_1;
else
W1=zeros(N,1);
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!