2017-04-18 1 views
0

최근에 옥타브로 실행하기 위해 matlab 사이트에서 일부 코드를 다운로드했습니다. 내가 다운로드 한 소스 코드 파일에서 여러 가지 기능을 호출하는 나에 의해 생성 된 test.m 파일을 실행하려고하면 나는 나타납니다matlab 버전 검사 코드 제거

octave:2> test

error: `verLessThan' undefined near line 101 column 8

error: called from:

error: /media/34GB/escola/efficientLBP/assignUserInputs.m at line 101, column 5

error: /media/34GB/escola/efficientLBP/efficientLBP.m at line 113, column 1

error: /media/34GB/escola/efficientLBP/test.m at line 5, column 7

내가

if isempty(funcParamsNames) 
     isNoFuncParamsNames=true; 
    else 
     if verLessThan('matlab', '7.14') % again, old version do not support 'stable'. 
      funcParamsNames=unique(funcParamsNames); % This can lead to bugs :(
     else 
      funcParamsNames=unique(funcParamsNames , 'stable'); 
     end% 
     isNoFuncParamsNames=false; 
    end 

그래서이 코드를 발견 소스 파일을 확인 이 기능을 알기 위해 옥타브를 만드는 방법이 있는지 궁금해하고있었습니다. 시간 내 주셔서 감사합니다.

+0

옥타브의'unique'이 (matlab에의이'(..., '분류')'독특한'독특한 좋아하지처럼 ... '안정적')', 당신이 [여기] (https://tio.run/nexus/octave#@[email protected]//8DAA)를 볼 수 있듯이. 만약 당신이 버전 Octave check에 'stable' ] (https://github.com/lmendo/MATL/blob/master/compatibility/unique_comp.m) –

답변

0

옥타브가 동일한 기능을 알고있는 것 같습니다. unique 그러나 Matlabs 'stable'과 같은 옵션은 없습니다.

고유 한 시도를하고 내가 뭘하는지 봅니다.

if isempty(funcParamsNames) 
    isNoFuncParamsNames=true; 
else 
    funcParamsNames=unique(funcParamsNames);  
    isNoFuncParamsNames=false; 
end 
+0

Florian에게 감사드립니다. 문제가 해결 된 것 같습니다. – user2752471

+0

여러분을 환영합니다! – Florian

0

당신이 'stable' 자신과 unique을 수행 할 수 있습니다

x = rand(1,10);x(5) = x(1); 
% if you have 'stable' 
y1 = unique(x,'stable'); 
% if you don't have 'stable' 
[y2,ia] = unique(x); 
[ia,idxs] = sort(ia); 
y2 = y2(idxs); 
% compare 
isequal(y1,y2)