Cody

Solution 2203704

Submitted on 10 Apr 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
% This test suite can be updated if inappropriate 'hacks' % are discovered in any submitted solutions, % so your score/size may therefore change over time.

2   Fail
x = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz & ftdbqf.'; s_correct.shift = 1; s_correct.message = 'Cancel Operation Phoenix immediately & escape.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

x = 'DBODFM PQFSBUJPO QIPFOJY JNNFEJBUFMZ & FTDBQF.' p = 25×46 char array 'CANCEL OPERATION PHOENIX IMMEDIATELY & ESCAPE.' 'BxMBDK NODQxSHNM OGNDMHW HLLDCHxSDKX & DRBxOD.' 'AwLACJ MNCPwRGML NFMCLGV GKKCBGwRCJW & CQAwNC.' 'xvKxBI LMBOvQFLK MELBKFU FJJBAFvQBIV & BPxvMB.' 'wuJwAH KLANuPEKJ LDKAJET EIIAxEuPAHU & AOwuLA.' 'vtIvxG JKxMtODJI KCJxIDS DHHxwDtOxGT & xNvtKx.' 'usHuwF IJwLsNCIH JBIwHCR CGGwvCsNwFS & wMusJw.' 'trGtvE HIvKrMBHG IAHvGBQ BFFvuBrMvER & vLtrIv.' 'sqFsuD GHuJqLAGF HxGuFAP AEEutAqLuDQ & uKsqHu.' 'rpErtC FGtIpKxFE GwFtExO xDDtsxpKtCP & tJrpGt.' 'qoDqsB EFsHoJwED FvEsDwN wCCsrwoJsBO & sIqoFs.' 'pnCprA DErGnIvDC EuDrCvM vBBrqvnIrAN & rHpnEr.' 'omBoqx CDqFmHuCB DtCqBuL uAAqpumHqxM & qGomDq.' 'nlAnpw BCpElGtBA CsBpAtK txxpotlGpwL & pFnlCp.' 'mkxmov ABoDkFsAx BrAoxsJ swwonskFovK & oEmkBo.' 'ljwlnu xAnCjErxw AqxnwrI rvvnmrjEnuJ & nDljAn.' 'kivkmt wxmBiDqwv xpwmvqH quumlqiDmtI & mCkixm.' 'jhujls vwlAhCpvu wovlupG pttlkphClsH & lBjhwl.' 'igtikr uvkxgBout vnuktoF osskjogBkrG & kAigvk.' 'hfshjq tujwfAnts umtjsnE nrrjinfAjqF & jxhfuj.' 'gergip stivexmsr tlsirmD mqqihmexipE & iwgeti.' 'fdqfho rshudwlrq skrhqlC lpphgldwhoD & hvfdsh.' 'ecpegn qrgtcvkqp rjqgpkB koogfkcvgnC & guecrg.' 'dbodfm pqfsbujpo qipfojA jnnfejbufmB & ftdbqf.' 'cancel operation phoenix immediatelA & escape.'

Output argument "s" (and maybe others) not assigned during call to "decode". Error in Test2 (line 4) s = decode(x);

3   Fail
x = 'Vwlyhapvu Wovlupe ilnpuz Ablzkhf! Vwlyhapvu Wovlupe pz vby avw wypvypaf.'; s_correct.shift = 7; s_correct.message = 'Operation Phoenix begins Tuesday! Operation Phoenix is our top priority.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

x = 'VWLYHAPVU WOVLUPE ILNPUZ ABLZKHF! VWLYHAPVU WOVLUPE PZ VBY AVW WYPVYPAF.' p = 25×73 char array 'UVKXGxOUT VNUKTOD HKMOTY xAKYJGE! UVKXGxOUT VNUKTOD OY UAX xUV VXOUXOxE.' 'TUJWFwNTS UMTJSNC GJLNSX wxJXIFD! TUJWFwNTS UMTJSNC NX TxW wTU UWNTWNwD.' 'STIVEvMSR TLSIRMB FIKMRW vwIWHEC! STIVEvMSR TLSIRMB MW SwV vST TVMSVMvC.' 'RSHUDuLRQ SKRHQLA EHJLQV uvHVGDB! RSHUDuLRQ SKRHQLA LV RvU uRS SULRULuB.' 'QRGTCtKQP RJQGPKx DGIKPU tuGUFCA! QRGTCtKQP RJQGPKx KU QuT tQR RTKQTKtA.' 'PQFSBsJPO QIPFOJw CFHJOT stFTEBx! PQFSBsJPO QIPFOJw JT PtS sPQ QSJPSJsx.' 'OPERArION PHOENIv BEGINS rsESDAw! OPERArION PHOENIv IS OsR rOP PRIORIrw.' 'NODQxqHNM OGNDMHu ADFHMR qrDRCxv! NODQxqHNM OGNDMHu HR NrQ qNO OQHNQHqv.' 'MNCPwpGML NFMCLGt xCEGLQ pqCQBwu! MNCPwpGML NFMCLGt GQ MqP pMN NPGMPGpu.' 'LMBOvoFLK MELBKFs wBDFKP opBPAvt! LMBOvoFLK MELBKFs FP LpO oLM MOFLOFot.' 'KLANunEKJ LDKAJEr vACEJO noAOxus! KLANunEKJ LDKAJEr EO KoN nKL LNEKNEns.' 'JKxMtmDJI KCJxIDq uxBDIN mnxNwtr! JKxMtmDJI KCJxIDq DN JnM mJK KMDJMDmr.' 'IJwLslCIH JBIwHCp twACHM lmwMvsq! IJwLslCIH JBIwHCp CM ImL lIJ JLCILClq.' 'HIvKrkBHG IAHvGBo svxBGL klvLurp! HIvKrkBHG IAHvGBo BL HlK kHI IKBHKBkp.' 'GHuJqjAGF HxGuFAn ruwAFK jkuKtqo! GHuJqjAGF HxGuFAn AK GkJ jGH HJAGJAjo.' 'FGtIpixFE GwFtExm qtvxEJ ijtJspn! FGtIpixFE GwFtExm xJ FjI iFG GIxFIxin.' 'EFsHohwED FvEsDwl psuwDI hisIrom! EFsHohwED FvEsDwl wI EiH hEF FHwEHwhm.' 'DErGngvDC EuDrCvk ortvCH ghrHqnl! DErGngvDC EuDrCvk vH DhG gDE EGvDGvgl.' 'CDqFmfuCB DtCqBuj nqsuBG fgqGpmk! CDqFmfuCB DtCqBuj uG CgF fCD DFuCFufk.' 'BCpEletBA CsBpAti mprtAF efpFolj! BCpEletBA CsBpAti tF BfE eBC CEtBEtej.' 'ABoDkdsAx BrAoxsh loqsxE deoEnki! ABoDkdsAx BrAoxsh sE AeD dAB BDsADsdi.' 'xAnCjcrxw Aqxnwrg knprwD cdnDmjh! xAnCjcrxw Aqxnwrg rD xdC cxA ACrxCrch.' 'wxmBibqwv xpwmvqf jmoqvC bcmClig! wxmBibqwv xpwmvqf qC wcB bwx xBqwBqbg.' 'vwlAhapvu wovlupe ilnpuB ablBkhf! vwlAhapvu wovlupe pB vbA avw wApvApaf.' 'uvkxgZout vnuktod hkmotA ZakAjge! uvkxgZout vnuktod oA uax Zuv vxouxoZe.'

Output argument "s" (and maybe others) not assigned during call to "decode". Error in Test3 (line 4) s = decode(x);

4   Fail
x = 'Eatpht cdit iwpi iwt ephhldgs wph qttc rwpcvts ugdb "Fxeudyn" id "Dvcsbwl". Diwtglxht Detgpixdc Ewdtcxm xh egdrttsxcv prrdgsxcv id eapc.'; s_correct.shift = 15; s_correct.message = 'Please note that the password has been changed from "Qipfojy" to "Ogndmhw". Otherwise Operation Phoenix is proceeding according to plan.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

x = 'EATPHT CDIT IWPI IWT EPHHLDGS WPH QTTC RWPCVTS UGDB "FXEUDYN" ID "DVCSBWL". DIWTGLXHT DETGPIXDC EWDTCXM XH EGDRTTSXCV PRRDGSXCV ID EAPC.' p = 25×137 char array 'DxSOGS BCHS HVOH HVS DOGGKCFR VOG PSSB QVOBUSR TFCA "EWDTCXM" HC "CUBRAVK". CHVSFKWGS CDSFOHWCB DVCSBWL WG DFCQSSRWBU OQQCFRWBU HC DxOB.' 'CwRNFR ABGR GUNG GUR CNFFJBEQ UNF ORRA PUNATRQ SEBx "DVCSBWL" GB "BTAQxUJ". BGUREJVFR BCRENGVBA CUBRAVK VF CEBPRRQVAT NPPBEQVAT GB CwNA.' 'BvQMEQ xAFQ FTMF FTQ BMEEIADP TME NQQx OTMxSQP RDAw "CUBRAVK" FA "ASxPwTI". AFTQDIUEQ ABQDMFUAx BTAQxUJ UE BDAOQQPUxS MOOADPUxS FA BvMx.' 'AuPLDP wxEP ESLE ESP ALDDHxCO SLD MPPw NSLwRPO QCxv "BTAQxUJ" Ex "xRwOvSH". xESPCHTDP xAPCLETxw ASxPwTI TD ACxNPPOTwR LNNxCOTwR Ex AuLw.' 'xtOKCO vwDO DRKD DRO xKCCGwBN RKC LOOv MRKvQON PBwu "ASxPwTI" Dw "wQvNuRG". wDROBGSCO wxOBKDSwv xRwOvSH SC xBwMOONSvQ KMMwBNSvQ Dw xtKv.' 'wsNJBN uvCN CQJC CQN wJBBFvAM QJB KNNu LQJuPNM OAvt "xRwOvSH" Cv "vPuMtQF". vCQNAFRBN vwNAJCRvu wQvNuRG RB wAvLNNMRuP JLLvAMRuP Cv wsJu.' 'vrMIAM tuBM BPIB BPM vIAAEuxL PIA JMMt KPItOML Nxus "wQvNuRG" Bu "uOtLsPE". uBPMxEQAM uvMxIBQut vPuMtQF QA vxuKMMLQtO IKKuxLQtO Bu vrIt.' 'uqLHxL stAL AOHA AOL uHxxDtwK OHx ILLs JOHsNLK Mwtr "vPuMtQF" At "tNsKrOD". tAOLwDPxL tuLwHAPts uOtLsPE Px uwtJLLKPsN HJJtwKPsN At uqHs.' 'tpKGwK rsxK xNGx xNK tGwwCsvJ NGw HKKr INGrMKJ Lvsq "uOtLsPE" xs "sMrJqNC". sxNKvCOwK stKvGxOsr tNsKrOD Ow tvsIKKJOrM GIIsvJOrM xs tpGr.' 'soJFvJ qrwJ wMFw wMJ sFvvBruI MFv GJJq HMFqLJI Kurp "tNsKrOD" wr "rLqIpMB". rwMJuBNvJ rsJuFwNrq sMrJqNC Nv surHJJINqL FHHruINqL wr soFq.' 'rnIEuI pqvI vLEv vLI rEuuAqtH LEu FIIp GLEpKIH Jtqo "sMrJqNC" vq "qKpHoLA". qvLItAMuI qrItEvMqp rLqIpMB Mu rtqGIIHMpK EGGqtHMpK vq rnEp.' 'qmHDtH opuH uKDu uKH qDttxpsG KDt EHHo FKDoJHG Ispn "rLqIpMB" up "pJoGnKx". puKHsxLtH pqHsDuLpo qKpHoLA Lt qspFHHGLoJ DFFpsGLoJ up qmDo.' 'plGCsG notG tJCt tJG pCssworF JCs DGGn EJCnIGF Hrom "qKpHoLA" to "oInFmJw". otJGrwKsG opGrCtKon pJoGnKx Ks proEGGFKnI CEEorFKnI to plCn.' 'okFBrF mnsF sIBs sIF oBrrvnqE IBr CFFm DIBmHFE Gqnl "pJoGnKx" sn "nHmElIv". nsIFqvJrF noFqBsJnm oInFmJw Jr oqnDFFEJmH BDDnqEJmH sn okBm.' 'njEAqE lmrE rHAr rHE nAqqumpD HAq BEEl CHAlGED Fpmk "oInFmJw" rm "mGlDkHu". mrHEpuIqE mnEpArIml nHmElIv Iq npmCEEDIlG ACCmpDIlG rm njAl.' 'miDxpD klqD qGxq qGD mxpptloC Gxp ADDk BGxkFDC Eolj "nHmElIv" ql "lFkCjGt". lqGDotHpD lmDoxqHlk mGlDkHu Hp molBDDCHkF xBBloCHkF ql mixk.' 'lhCwoC jkpC pFwp pFC lwoosknB Fwo xCCj AFwjECB Dnki "mGlDkHu" pk "kEjBiFs". kpFCnsGoC klCnwpGkj lFkCjGt Go lnkACCBGjE wAAknBGjE pk lhwj.' 'kgBvnB ijoB oEvo oEB kvnnrjmA Evn wBBi xEviDBA Cmjh "lFkCjGt" oj "jDiAhEr". joEBmrFnB jkBmvoFji kEjBiFs Fn kmjxBBAFiD vxxjmAFiD oj kgvi.' 'jfAumA hinA nDun nDA jummqilx Dum vAAh wDuhCAx Blig "kEjBiFs" ni "iChxgDq". inDAlqEmA ijAlunEih jDiAhEr Em jliwAAxEhC uwwilxEhC ni jfuh.' 'iextlx ghmx mCtm mCx itllphkw Ctl uxxg vCtgBxw Akhf "jDiAhEr" mh "hBgwfCp". hmCxkpDlx hixktmDhg iChxgDq Dl ikhvxxwDgB tvvhkwDgB mh ietg.' 'hdwskw fglw lBsl lBw hskkogjv Bsk twwf uBsfAwv xjge "iChxgDq" lg "gAfveBo". glBwjoCkw ghwjslCgf hBgwfCp Ck hjguwwvCfA suugjvCfA lg hdsf.' 'gcvrjv efkv kArk kAv grjjnfiu Arj svve tArexvu wifd "hBgwfCp" kf "fxeudAn". fkAvinBjv fgvirkBfe gAfveBo Bj giftvvuBex rttfiuBex kf gcre.' 'fbuqiu deju jxqj jxu fqiimeht xqi ruud sxqdwut vhec "gAfveBo" je "ewdtcxm". ejxuhmAiu efuhqjAed fxeudAn Ai fhesuutAdw qssehtAdw je fbqd.' 'eatpht cdit iwpi iwt ephhldgs wph qttc rwpcvts ugdb "fxeudAn" id "dvcsbwl". diwtglxht detgpixdc ewdtcxm xh egdrttsxcv prrdgsxcv id eapc.' 'dZsogs bchs hvoh hvs doggkcfr vog pssb qvobusr tfca "ewdtcxm" hc "cubravk". chvsfkwgs cdsfohwcb dvcsbwl wg dfcqssrwbu oqqcfrwbu hc dZob.'

Output argument "s" (and maybe others) not assigned during call to "decode". Error in Test4 (line 4) s = decode(x);

5   Fail
x = 'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem. Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.'; s_correct.shift = 24; s_correct.message = 'Operation Phoenix started three days ago. All personnel are to remain on duty until Operation Phoenix is completed.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

x = 'MNCPYRGML NFMCLGV QRYPRCB RFPCC BYWQ YEM. YJJ NCPQMLLCJ YPC RM PCKYGL ML BSRW SLRGJ MNCPYRGML NFMCLGV GQ AMKNJCRCB.' p = 25×116 char array 'LMBOXQFLK MELBKFU PQXOQBA QEOBB AXVP XDL. XII MBOPLKKBI XOB QL OBJXFK LK ARQV RKQFI LMBOXQFLK MELBKFU FP xLJMIBQBA.' 'KLANWPEKJ LDKAJET OPWNPAx PDNAA xWUO WCK. WHH LANOKJJAH WNA PK NAIWEJ KJ xQPU QJPEH KLANWPEKJ LDKAJET EO wKILHAPAx.' 'JKxMVODJI KCJxIDS NOVMOxw OCMxx wVTN VBJ. VGG KxMNJIIxG VMx OJ MxHVDI JI wPOT PIODG JKxMVODJI KCJxIDS DN vJHKGxOxw.' 'IJwLUNCIH JBIwHCR MNULNwv NBLww vUSM UAI. UFF JwLMIHHwF ULw NI LwGUCH IH vONS OHNCF IJwLUNCIH JBIwHCR CM uIGJFwNwv.' 'HIvKTMBHG IAHvGBQ LMTKMvu MAKvv uTRL TxH. TEE IvKLHGGvE TKv MH KvFTBG HG uNMR NGMBE HIvKTMBHG IAHvGBQ BL tHFIEvMvu.' 'GHuJSLAGF HxGuFAP KLSJLut LxJuu tSQK SwG. SDD HuJKGFFuD SJu LG JuESAF GF tMLQ MFLAD GHuJSLAGF HxGuFAP AK sGEHDuLut.' 'FGtIRKxFE GwFtExO JKRIKts KwItt sRPJ RvF. RCC GtIJFEEtC RIt KF ItDRxE FE sLKP LEKxC FGtIRKxFE GwFtExO xJ rFDGCtKts.' 'EFsHQJwED FvEsDwN IJQHJsr JvHss rQOI QuE. QBB FsHIEDDsB QHs JE HsCQwD ED rKJO KDJwB EFsHQJwED FvEsDwN wI qECFBsJsr.' 'DErGPIvDC EuDrCvM HIPGIrq IuGrr qPNH PtD. PAA ErGHDCCrA PGr ID GrBPvC DC qJIN JCIvA DErGPIvDC EuDrCvM vH pDBEArIrq.' 'CDqFOHuCB DtCqBuL GHOFHqp HtFqq pOMG OsC. Oxx DqFGCBBqx OFq HC FqAOuB CB pIHM IBHux CDqFOHuCB DtCqBuL uG oCADxqHqp.' 'BCpENGtBA CsBpAtK FGNEGpo GsEpp oNLF NrB. Nww CpEFBAApw NEp GB EpxNtA BA oHGL HAGtw BCpENGtBA CsBpAtK tF nBxCwpGpo.' 'ABoDMFsAx BrAoxsJ EFMDFon FrDoo nMKE MqA. Mvv BoDEAxxov MDo FA DowMsx Ax nGFK GxFsv ABoDMFsAx BrAoxsJ sE mAwBvoFon.' 'xAnCLErxw AqxnwrI DELCEnm EqCnn mLJD Lpx. Luu AnCDxwwnu LCn Ex CnvLrw xw mFEJ FwEru xAnCLErxw AqxnwrI rD lxvAunEnm.' 'wxmBKDqwv xpwmvqH CDKBDml DpBmm lKIC Kow. Ktt xmBCwvvmt KBm Dw BmuKqv wv lEDI EvDqt wxmBKDqwv xpwmvqH qC kwuxtmDml.' 'vwlAJCpvu wovlupG BCJAClk CoAll kJHB Jnv. Jss wlABvuuls JAl Cv AltJpu vu kDCH DuCps vwlAJCpvu wovlupG pB jvtwslClk.' 'uvkxIBout vnuktoF ABIxBkj Bnxkk jIGA Imu. Irr vkxAuttkr Ixk Bu xksIot ut jCBG CtBor uvkxIBout vnuktoF oA iusvrkBkj.' 'tujwHAnts umtjsnE xAHwAji Amwjj iHFx Hlt. Hqq ujwxtssjq Hwj At wjrHns ts iBAF BsAnq tujwHAnts umtjsnE nx htruqjAji.' 'stivGxmsr tlsirmD wxGvxih xlvii hGEw Gks. Gpp tivwsrrip Gvi xs viqGmr sr hAxE Arxmp stivGxmsr tlsirmD mw gsqtpixih.' 'rshuFwlrq skrhqlC vwFuwhg wkuhh gFDv Fjr. Foo shuvrqqho Fuh wr uhpFlq rq gxwD xqwlo rshuFwlrq skrhqlC lv frpsohwhg.' 'qrgtEvkqp rjqgpkB uvEtvgf vjtgg fECu Eiq. Enn rgtuqppgn Etg vq tgoEkp qp fwvC wpvkn qrgtEvkqp rjqgpkB ku eqorngvgf.' 'pqfsDujpo qipfojA tuDsufe uisff eDBt Dhp. Dmm qfstpoofm Dsf up sfnDjo po evuB voujm pqfsDujpo qipfojA jt dpnqmfufe.' 'operCtion phoenix stCrted three dCAs Cgo. Cll personnel Cre to remCin on dutA until operCtion phoenix is completed.' 'nodqBshnm ogndmhw rsBqsdc sgqdd cBxr Bfn. Bkk odqrnmmdk Bqd sn qdlBhm nm ctsx tmshk nodqBshnm ogndmhw hr bnlokdsdc.' 'mncpArgml nfmclgv qrAprcb rfpcc bAwq Aem. Ajj ncpqmllcj Apc rm pckAgl ml bsrw slrgj mncpArgml nfmclgv gq amknjcrcb.' 'lmboxqflk melbkfu pqxoqba qeobb axvp xdl. xii mboplkkbi xob ql objxfk lk arqv rkqfi lmboxqflk melbkfu fp Zljmibqba.'

Output argument "s" (and maybe others) not assigned during call to "decode". Error in Test5 (line 4) s = decode(x);

6   Fail
% Acknowledgements % Portions of this timing test code were inspired by: % (1) Problem 937. "Rubik's Mini Cube: Solve Randomized Cube in 11 Moves or Less; Score is by Time (msec)" by Richard Zapor. % (2) Problem 2733. "Evil Number" by Jan Orwat. % (3) Feedback in comments from Peng Liu. % (4) Problem Problem 1237. "It's race time! Write a faster function than the test suite call of unique()." by Jeremy. % Note: The Time Trial section does not check accuracy; that is done above. % Initialise x = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz & ftdbqf.'; cutoffTimeBig = 1000; % Maximum allowable walltime (in milliseconds) to run function in a loop with qBig iterations. for dummy = 1 : 20, disp(' . '); end; % Run once, untimed? includeOverheads = false; if includeOverheads, solution = decode( x ); end; % *** PRELIMINARY TIMING *** % In case the submitted function has a lot of text output, % get an estimate based on just a few iterations % Initialise qSmall = 50; qBig = 5000; t0 = clock; % Loop for i = 1 : qSmall solution = decode( x ); end; % Compute and display elapsed time. dt = etime(clock, t0) * 1000; disp(' -----=====----- ') fprintf('Your wall time to decode %u messages = %i msec.\n\r', qSmall, floor(dt)) fprintf('Your APPROXIMATE wall time to decode %u messages would be ~ %i msec.\n\r', qBig, ceil(dt * qBig / qSmall)) disp(' -----=====----- ') for dummy = 1 : 20, disp(' . '); end; % *** 'OFFICIAL' TIMING *** % Re-initialise timer t0 = clock; t0_cpu = cputime; % Loop for i = 1 : qBig solution = decode( x ); end; % Compute and display elapsed time. for dummy = 1 : 20, disp(' . '); end; disp(' -----=====|||||=====----- ') dt = etime(clock, t0) * 1000; fprintf('Your wall time to decode %u messages = %i msec.\n\r', qBig, floor(dt)) dt_cpu = (cputime - t0_cpu) * 1000; fprintf(' ( Your CPU time for this = %i msec. ) \n\r', floor(dt_cpu)) fDecode = @() decode(x); dt_timeit = timeit( fDecode ) * 1000; fprintf(' [ Your ''timeit'' time to decode %u messages = %i msec. ] \n\r', qBig, ceil(dt_timeit * qBig)) % Display a size-based score. all_nodes = mtree('decode.m', '-file'); % This is the default in Cody. str_nodes = mtfind(all_nodes, 'Kind', 'STRING'); eq_nodes = mtfind(all_nodes, 'Kind', 'EQUALS'); print_nodes = mtfind(all_nodes, 'Kind', 'PRINT'); expr_nodes = mtfind(all_nodes, 'Kind', 'EXPR'); size_score = count(all_nodes) ... +sum(str_nodes.nodesize-1) ... +2*(count(expr_nodes) ... +count(print_nodes) ... -count(eq_nodes)); fprintf('Your size-based score = %i.\n\r', size_score) % Report revised performance score. combinedScore = size_score + min( 200, floor(dt*(500/qBig)) ); fprintf('Your combined score = %i.\n\r', combinedScore) disp(' -----=====|||||=====----- ') % Now disallow any candidate solutions that are TOO SLOW! if dt > cutoffTimeBig, fprintf('Sorry, your submission is TOO SLOW. It must be able to finish within %u milliseconds.\n\r', cutoffTimeBig) end; assert( dt <= cutoffTimeBig, 'Exceeded time limit specified in Test Suite.' )

. . . . . . . . . . . . . . . . . . . . x = 'DBODFM PQFSBUJPO QIPFOJY JNNFEJBUFMZ & FTDBQF.' p = 25×46 char array 'CANCEL OPERATION PHOENIX IMMEDIATELY & ESCAPE.' 'BxMBDK NODQxSHNM OGNDMHW HLLDCHxSDKX & DRBxOD.' 'AwLACJ MNCPwRGML NFMCLGV GKKCBGwRCJW & CQAwNC.' 'xvKxBI LMBOvQFLK MELBKFU FJJBAFvQBIV & BPxvMB.' 'wuJwAH KLANuPEKJ LDKAJET EIIAxEuPAHU & AOwuLA.' 'vtIvxG JKxMtODJI KCJxIDS DHHxwDtOxGT & xNvtKx.' 'usHuwF IJwLsNCIH JBIwHCR CGGwvCsNwFS & wMusJw.' 'trGtvE HIvKrMBHG IAHvGBQ BFFvuBrMvER & vLtrIv.' 'sqFsuD GHuJqLAGF HxGuFAP AEEutAqLuDQ & uKsqHu.' 'rpErtC FGtIpKxFE GwFtExO xDDtsxpKtCP & tJrpGt.' 'qoDqsB EFsHoJwED FvEsDwN wCCsrwoJsBO & sIqoFs.' 'pnCprA DErGnIvDC EuDrCvM vBBrqvnIrAN & rHpnEr.' 'omBoqx CDqFmHuCB DtCqBuL uAAqpumHqxM & qGomDq.' 'nlAnpw BCpElGtBA CsBpAtK txxpotlGpwL & pFnlCp.' 'mkxmov ABoDkFsAx BrAoxsJ swwonskFovK & oEmkBo.' 'ljwlnu xAnCjErxw AqxnwrI rvvnmrjEnuJ & nDljAn.' 'kivkmt wxmBiDqwv xpwmvqH quumlqiDmtI & mCkixm.' 'jhujls vwlAhCpvu wovlupG pttlkphClsH & lBjhwl.' 'igtikr uvkxgBout vnuktoF osskjogBkrG & kAigvk.' 'hfshjq tujwfAnts umtjsnE nrrjinfAjqF & jxhfuj.' 'gergip stivexmsr tlsirmD mqqihmexipE & iwgeti.' 'fdqfho rshudwlrq skrhqlC lpphgldwhoD & hvfdsh.' 'ecpegn qrgtcvkqp rjqgpkB koogfkcvgnC & guecrg.' 'dbodfm pqfsbujpo qipfojA jnnfejbufmB & ftdbqf.' 'cancel operation phoenix immediatelA & escape.'

Output argument "s" (and maybe others) not assigned during call to "decode". Error in Test6 (line 32) solution = decode( x );