How does this function work? - echo, assert ...

조회 수: 1 (최근 30일)
Daigo
Daigo 2022년 1월 20일
답변: Walter Roberson 2022년 1월 20일
I found this solution in Cody but I have no idea what is going on.
function ans = remove_from_cell_array(x,to_remove)
! echo "function assert(~) " >./assert.m
end
Does anyone know how this function is working? This function is supposed to remove specific elements (specified by `to_remove`) from a cell array, `x`.
  댓글 수: 1
Daigo
Daigo 2022년 1월 20일
I guess this function is fooling the score calculator of Cody. I'm curious how it is fooling....

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 1월 20일
The function does none of the actual work needed. Instead it overrides the functions that are used to check that the solution works, so in each case the altered code says "No problem here!" when the scoring function goes to test the code.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by