{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":2997,"title":"Kelvin to Celsius","description":"Degrees Celsius = degrees Kelvin - 273.15.\r\n\r\nGiven a temperature in Kelvin, return the equivalent temperature in Celsius.","description_html":"\u003cp\u003eDegrees Celsius = degrees Kelvin - 273.15.\u003c/p\u003e\u003cp\u003eGiven a temperature in Kelvin, return the equivalent temperature in Celsius.\u003c/p\u003e","function_template":"function y = kelvin(x)\r\n  y = x - 273.15 ;\r\nend","test_suite":"%%\r\nx = 360;\r\ny_correct = 86.85;\r\nassert(isequal(kelvin(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":35805,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":"2015-02-10T22:22:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-10T22:15:31.000Z","updated_at":"2026-02-18T15:17:47.000Z","published_at":"2015-02-10T22:22:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDegrees Celsius = degrees Kelvin - 273.15.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a temperature in Kelvin, return the equivalent temperature in Celsius.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":925,"title":"Unique - Very Very Large Numbers","description":"Given a vector column, with some very large numbers, create the ascending sort and unique vector.\r\n\r\n*Input:* A  (column vector)\r\n\r\n*Output:* B (unique and ascending sorted column vector)\r\n\r\n*Examples:* [5;4;3;2;2;1] outputs [1;2;3;4;5]\r\n\r\n[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808] ","description_html":"\u003cp\u003eGiven a vector column, with some very large numbers, create the ascending sort and unique vector.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e A  (column vector)\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e B (unique and ascending sorted column vector)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [5;4;3;2;2;1] outputs [1;2;3;4;5]\u003c/p\u003e\u003cp\u003e[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808]\u003c/p\u003e","function_template":"function y = unique_large(x)\r\n  y = unique(x);\r\nend","test_suite":"%%\r\na=randi(2^32,100,'uint32');\r\nassert(isequal(unique_large(a),unique(a)))\r\n%%\r\nformat long\r\na=[uint64(9223372036854775808);uint64(9223372036854775806)];\r\nout=unique_large(a);\r\nassert(isequal(out,flipud(a)),sprintf('\\nsize(a)= %i %i \\noutput= \\n %14.0f\\n %14.0f \\n',size(out),out))\r\n%%\r\nformat long\r\na=[uint64(18446744073709551615);uint64(18233720368547758060);uint64(9223372036854779806)];\r\n\r\nout=unique_large(a);\r\n\r\nassert(isequal(out,flipud(a)),sprintf('\\nsize(a)= %i %i \\noutput= \\n %16.0f \\n %16.0f \\n %16.0f \\n',size(out),out))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-08-29T18:59:33.000Z","updated_at":"2026-03-24T06:44:26.000Z","published_at":"2012-08-29T19:55:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector column, with some very large numbers, create the ascending sort and unique vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e A (column vector)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e B (unique and ascending sorted column vector)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [5;4;3;2;2;1] outputs [1;2;3;4;5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":921,"title":"REPMAT  Enhancement - Faster for Large Row Replication of Vector ","description":"The Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u003e1 cases,\r\nB=repmat(A,M,N).  The size of A for enhancement cases is [1,n].\r\n\r\nFor cases of M\u003e 12,288,000 and n\u003c128 or N*n\u003c256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\r\n\r\n*Input:* [A,M,N]  standard input for repmat\r\n\r\n* A: Vector (row or column) or an array\r\n* M: row duplication factor of A\r\n* N: column replication factor of A\r\n\r\n*Output:* B, Array of size [M*m,N*n] where [m,n]=size(A)\r\n\r\n*Score:* Performance is based upon time(msec) to execute four large row replications\r\n\r\nTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\r\n\r\n* 1: r [1,12] of uint32, M=6144000, N=4\r\n* 2: r [1,12] of uint8, M=6144000, N=16\r\n* 3: r [1,48] of uint32, M=6144000, N=1\r\n* 4: r [1,48] of uint8, M=12288000, N=1\r\n* Test cases are sized to not hit the memory limit and clears are implemented.\r\n\r\n\r\n*Potential Path:*\r\n\r\nI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\r\n\r\n# command window; open repmat\r\n# file: save as: to local folder with new name\r\n# Create Shell calling function\r\n# From the Editor/Shell; Tools: Open Profiler\r\n# From Profiler Window:  Start Profiling  (Fourth row top left)\r\n# Explore the results of the profiler windows\r\n\r\nNote: The above cases assume a 3GB system or better. Reduce M as necessary.\r\n\r\n\r\nThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\r\n\r\nA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u003c 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time. \r\n\r\n\r\nEnjoy.","description_html":"\u003cp\u003eThe Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u003e1 cases,\r\nB=repmat(A,M,N).  The size of A for enhancement cases is [1,n].\u003c/p\u003e\u003cp\u003eFor cases of M\u003e 12,288,000 and n\u0026lt;128 or N*n\u0026lt;256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [A,M,N]  standard input for repmat\u003c/p\u003e\u003cul\u003e\u003cli\u003eA: Vector (row or column) or an array\u003c/li\u003e\u003cli\u003eM: row duplication factor of A\u003c/li\u003e\u003cli\u003eN: column replication factor of A\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e B, Array of size [M*m,N*n] where [m,n]=size(A)\u003c/p\u003e\u003cp\u003e\u003cb\u003eScore:\u003c/b\u003e Performance is based upon time(msec) to execute four large row replications\u003c/p\u003e\u003cp\u003eTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1: r [1,12] of uint32, M=6144000, N=4\u003c/li\u003e\u003cli\u003e2: r [1,12] of uint8, M=6144000, N=16\u003c/li\u003e\u003cli\u003e3: r [1,48] of uint32, M=6144000, N=1\u003c/li\u003e\u003cli\u003e4: r [1,48] of uint8, M=12288000, N=1\u003c/li\u003e\u003cli\u003eTest cases are sized to not hit the memory limit and clears are implemented.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003ePotential Path:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\u003c/p\u003e\u003col\u003e\u003cli\u003ecommand window; open repmat\u003c/li\u003e\u003cli\u003efile: save as: to local folder with new name\u003c/li\u003e\u003cli\u003eCreate Shell calling function\u003c/li\u003e\u003cli\u003eFrom the Editor/Shell; Tools: Open Profiler\u003c/li\u003e\u003cli\u003eFrom Profiler Window:  Start Profiling  (Fourth row top left)\u003c/li\u003e\u003cli\u003eExplore the results of the profiler windows\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eNote: The above cases assume a 3GB system or better. Reduce M as necessary.\u003c/p\u003e\u003cp\u003eThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\u003c/p\u003e\u003cp\u003eA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u0026lt; 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time.\u003c/p\u003e\u003cp\u003eEnjoy.\u003c/p\u003e","function_template":"function B = repmatLV(A,M,N)\r\n% B=repmat(A,M,N);  % Will create a Passing solution - but slow\r\n  B=A;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',0);\r\n%%\r\n% Testing for standard repmat capability\r\na=magic(5);\r\nM=randi(4);\r\nN=randi(8);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=5;\r\nM=randi(10);\r\nN=randi(10);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=5;\r\nM=randi(10);\r\nN=1;\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=4;\r\nM=1;\r\nN=randi(10);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=magic(8);\r\nM=2;\r\nN=2;\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\n%%\r\nM=1024;\r\nN=1;\r\nn=48;\r\nr=randi(255,1,n,'uint8');\r\n%r=double(r);\r\n\r\nfor i=1:5  % Routine warm-up\r\n  r_repmatLV=repmatLV(r,M,N);\r\nend\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=4;\r\nn=12;\r\nr=randi(2^31,1,n,'uint32');\r\n\r\nta=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt1=etime(clock,ta)*1000;\r\nP1=isequal(r(1,12),r_repmatLV(M,n*N));\r\nP2=isequal(r(1,12),r_repmatLV(randi(10000),36));\r\nassert(P1 \u0026\u0026 P2  \u0026\u0026 ~ P3  \u0026\u0026 ~P4)\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=16;\r\nn=12;\r\nr=randi(255,1,n,'uint8');\r\n\r\ntb=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt2=etime(clock,tb)*1000;\r\nP2=isequal(r(1,12),r_repmatLV(M,n*N));\r\nassert(P2 \u0026\u0026 ~P1  \u0026\u0026 ~ P3  \u0026\u0026 ~P4)\r\n\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=1;\r\nn=48;\r\nr=randi(2^31,1,n,'uint32');\r\n\r\ntc=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt3=etime(clock,tc)*1000;\r\nP3=isequal(r(1,1),r_repmatLV(M,1));\r\nassert(P3 \u0026\u0026 ~P1  \u0026\u0026 ~ P2  \u0026\u0026 ~P4)\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=12288000;\r\nN=1;\r\nn=48;\r\nr=randi(255,1,n,'uint8');\r\n\r\ntd=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt4=etime(clock,td)*1000;\r\nP4=isequal(r(1,48),r_repmatLV(1000000,48));\r\nassert(P4 \u0026\u0026 ~P3  \u0026\u0026 ~ P2  \u0026\u0026 ~P1)\r\n\r\nclear r_repmatLV\r\n% This checks for sub-optimal column processing\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=64;\r\nN=1;\r\nn=4000000;\r\nr=randi(255,1,n,'uint8');\r\n\r\nte=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt5=etime(clock,te)*1000;\r\nP5=isequal(r(1,n),r_repmatLV(M,n));\r\nassert(P5)\r\n\r\nfeval(@assignin,'caller','score',0);\r\nif P5\r\n sum_dt=min(15000,t1+t2+t3+t4+t5); % repmat scores 12000\r\n feval(@assignin,'caller','score',floor(sum_dt));\r\nend\r\n\r\nfprintf('Times: %.0f %.0f %.0f %.0f %.0f  Total %.0f msec\\n',t1,t2,t3,t4,t5,t1+t2+t3+t4+t5)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-08-25T20:11:30.000Z","updated_at":"2026-03-11T11:30:11.000Z","published_at":"2012-08-26T00:53:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u0026gt;1 cases, B=repmat(A,M,N). The size of A for enhancement cases is [1,n].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor cases of M\u0026gt; 12,288,000 and n\u0026lt;128 or N*n\u0026lt;256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [A,M,N] standard input for repmat\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA: Vector (row or column) or an array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM: row duplication factor of A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eN: column replication factor of A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e B, Array of size [M*m,N*n] where [m,n]=size(A)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eScore:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Performance is based upon time(msec) to execute four large row replications\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1: r [1,12] of uint32, M=6144000, N=4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2: r [1,12] of uint8, M=6144000, N=16\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3: r [1,48] of uint32, M=6144000, N=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4: r [1,48] of uint8, M=12288000, N=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest cases are sized to not hit the memory limit and clears are implemented.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePotential Path:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecommand window; open repmat\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efile: save as: to local folder with new name\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate Shell calling function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFrom the Editor/Shell; Tools: Open Profiler\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFrom Profiler Window: Start Profiling (Fourth row top left)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExplore the results of the profiler windows\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The above cases assume a 3GB system or better. Reduce M as necessary.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u0026lt; 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEnjoy.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":2997,"title":"Kelvin to Celsius","description":"Degrees Celsius = degrees Kelvin - 273.15.\r\n\r\nGiven a temperature in Kelvin, return the equivalent temperature in Celsius.","description_html":"\u003cp\u003eDegrees Celsius = degrees Kelvin - 273.15.\u003c/p\u003e\u003cp\u003eGiven a temperature in Kelvin, return the equivalent temperature in Celsius.\u003c/p\u003e","function_template":"function y = kelvin(x)\r\n  y = x - 273.15 ;\r\nend","test_suite":"%%\r\nx = 360;\r\ny_correct = 86.85;\r\nassert(isequal(kelvin(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":35805,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":"2015-02-10T22:22:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-10T22:15:31.000Z","updated_at":"2026-02-18T15:17:47.000Z","published_at":"2015-02-10T22:22:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDegrees Celsius = degrees Kelvin - 273.15.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a temperature in Kelvin, return the equivalent temperature in Celsius.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":925,"title":"Unique - Very Very Large Numbers","description":"Given a vector column, with some very large numbers, create the ascending sort and unique vector.\r\n\r\n*Input:* A  (column vector)\r\n\r\n*Output:* B (unique and ascending sorted column vector)\r\n\r\n*Examples:* [5;4;3;2;2;1] outputs [1;2;3;4;5]\r\n\r\n[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808] ","description_html":"\u003cp\u003eGiven a vector column, with some very large numbers, create the ascending sort and unique vector.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e A  (column vector)\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e B (unique and ascending sorted column vector)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [5;4;3;2;2;1] outputs [1;2;3;4;5]\u003c/p\u003e\u003cp\u003e[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808]\u003c/p\u003e","function_template":"function y = unique_large(x)\r\n  y = unique(x);\r\nend","test_suite":"%%\r\na=randi(2^32,100,'uint32');\r\nassert(isequal(unique_large(a),unique(a)))\r\n%%\r\nformat long\r\na=[uint64(9223372036854775808);uint64(9223372036854775806)];\r\nout=unique_large(a);\r\nassert(isequal(out,flipud(a)),sprintf('\\nsize(a)= %i %i \\noutput= \\n %14.0f\\n %14.0f \\n',size(out),out))\r\n%%\r\nformat long\r\na=[uint64(18446744073709551615);uint64(18233720368547758060);uint64(9223372036854779806)];\r\n\r\nout=unique_large(a);\r\n\r\nassert(isequal(out,flipud(a)),sprintf('\\nsize(a)= %i %i \\noutput= \\n %16.0f \\n %16.0f \\n %16.0f \\n',size(out),out))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-08-29T18:59:33.000Z","updated_at":"2026-03-24T06:44:26.000Z","published_at":"2012-08-29T19:55:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector column, with some very large numbers, create the ascending sort and unique vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e A (column vector)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e B (unique and ascending sorted column vector)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [5;4;3;2;2;1] outputs [1;2;3;4;5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e[9223372036854775808;9223372036854775806] outputs [9223372036854775806;9223372036854775808]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":921,"title":"REPMAT  Enhancement - Faster for Large Row Replication of Vector ","description":"The Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u003e1 cases,\r\nB=repmat(A,M,N).  The size of A for enhancement cases is [1,n].\r\n\r\nFor cases of M\u003e 12,288,000 and n\u003c128 or N*n\u003c256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\r\n\r\n*Input:* [A,M,N]  standard input for repmat\r\n\r\n* A: Vector (row or column) or an array\r\n* M: row duplication factor of A\r\n* N: column replication factor of A\r\n\r\n*Output:* B, Array of size [M*m,N*n] where [m,n]=size(A)\r\n\r\n*Score:* Performance is based upon time(msec) to execute four large row replications\r\n\r\nTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\r\n\r\n* 1: r [1,12] of uint32, M=6144000, N=4\r\n* 2: r [1,12] of uint8, M=6144000, N=16\r\n* 3: r [1,48] of uint32, M=6144000, N=1\r\n* 4: r [1,48] of uint8, M=12288000, N=1\r\n* Test cases are sized to not hit the memory limit and clears are implemented.\r\n\r\n\r\n*Potential Path:*\r\n\r\nI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\r\n\r\n# command window; open repmat\r\n# file: save as: to local folder with new name\r\n# Create Shell calling function\r\n# From the Editor/Shell; Tools: Open Profiler\r\n# From Profiler Window:  Start Profiling  (Fourth row top left)\r\n# Explore the results of the profiler windows\r\n\r\nNote: The above cases assume a 3GB system or better. Reduce M as necessary.\r\n\r\n\r\nThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\r\n\r\nA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u003c 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time. \r\n\r\n\r\nEnjoy.","description_html":"\u003cp\u003eThe Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u003e1 cases,\r\nB=repmat(A,M,N).  The size of A for enhancement cases is [1,n].\u003c/p\u003e\u003cp\u003eFor cases of M\u003e 12,288,000 and n\u0026lt;128 or N*n\u0026lt;256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [A,M,N]  standard input for repmat\u003c/p\u003e\u003cul\u003e\u003cli\u003eA: Vector (row or column) or an array\u003c/li\u003e\u003cli\u003eM: row duplication factor of A\u003c/li\u003e\u003cli\u003eN: column replication factor of A\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e B, Array of size [M*m,N*n] where [m,n]=size(A)\u003c/p\u003e\u003cp\u003e\u003cb\u003eScore:\u003c/b\u003e Performance is based upon time(msec) to execute four large row replications\u003c/p\u003e\u003cp\u003eTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1: r [1,12] of uint32, M=6144000, N=4\u003c/li\u003e\u003cli\u003e2: r [1,12] of uint8, M=6144000, N=16\u003c/li\u003e\u003cli\u003e3: r [1,48] of uint32, M=6144000, N=1\u003c/li\u003e\u003cli\u003e4: r [1,48] of uint8, M=12288000, N=1\u003c/li\u003e\u003cli\u003eTest cases are sized to not hit the memory limit and clears are implemented.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003cb\u003ePotential Path:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\u003c/p\u003e\u003col\u003e\u003cli\u003ecommand window; open repmat\u003c/li\u003e\u003cli\u003efile: save as: to local folder with new name\u003c/li\u003e\u003cli\u003eCreate Shell calling function\u003c/li\u003e\u003cli\u003eFrom the Editor/Shell; Tools: Open Profiler\u003c/li\u003e\u003cli\u003eFrom Profiler Window:  Start Profiling  (Fourth row top left)\u003c/li\u003e\u003cli\u003eExplore the results of the profiler windows\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eNote: The above cases assume a 3GB system or better. Reduce M as necessary.\u003c/p\u003e\u003cp\u003eThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\u003c/p\u003e\u003cp\u003eA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u0026lt; 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time.\u003c/p\u003e\u003cp\u003eEnjoy.\u003c/p\u003e","function_template":"function B = repmatLV(A,M,N)\r\n% B=repmat(A,M,N);  % Will create a Passing solution - but slow\r\n  B=A;\r\nend","test_suite":"%%\r\nfeval(@assignin,'caller','score',0);\r\n%%\r\n% Testing for standard repmat capability\r\na=magic(5);\r\nM=randi(4);\r\nN=randi(8);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=5;\r\nM=randi(10);\r\nN=randi(10);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=5;\r\nM=randi(10);\r\nN=1;\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=4;\r\nM=1;\r\nN=randi(10);\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\na=magic(8);\r\nM=2;\r\nN=2;\r\nassert(isequal(repmat(a,M,N),repmatLV(a,M,N)));\r\n%%\r\nM=1024;\r\nN=1;\r\nn=48;\r\nr=randi(255,1,n,'uint8');\r\n%r=double(r);\r\n\r\nfor i=1:5  % Routine warm-up\r\n  r_repmatLV=repmatLV(r,M,N);\r\nend\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=4;\r\nn=12;\r\nr=randi(2^31,1,n,'uint32');\r\n\r\nta=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt1=etime(clock,ta)*1000;\r\nP1=isequal(r(1,12),r_repmatLV(M,n*N));\r\nP2=isequal(r(1,12),r_repmatLV(randi(10000),36));\r\nassert(P1 \u0026\u0026 P2  \u0026\u0026 ~ P3  \u0026\u0026 ~P4)\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=16;\r\nn=12;\r\nr=randi(255,1,n,'uint8');\r\n\r\ntb=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt2=etime(clock,tb)*1000;\r\nP2=isequal(r(1,12),r_repmatLV(M,n*N));\r\nassert(P2 \u0026\u0026 ~P1  \u0026\u0026 ~ P3  \u0026\u0026 ~P4)\r\n\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=6144000;\r\nN=1;\r\nn=48;\r\nr=randi(2^31,1,n,'uint32');\r\n\r\ntc=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt3=etime(clock,tc)*1000;\r\nP3=isequal(r(1,1),r_repmatLV(M,1));\r\nassert(P3 \u0026\u0026 ~P1  \u0026\u0026 ~ P2  \u0026\u0026 ~P4)\r\n\r\n\r\nclear r_repmatLV\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=12288000;\r\nN=1;\r\nn=48;\r\nr=randi(255,1,n,'uint8');\r\n\r\ntd=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt4=etime(clock,td)*1000;\r\nP4=isequal(r(1,48),r_repmatLV(1000000,48));\r\nassert(P4 \u0026\u0026 ~P3  \u0026\u0026 ~ P2  \u0026\u0026 ~P1)\r\n\r\nclear r_repmatLV\r\n% This checks for sub-optimal column processing\r\nP1=false; P2=false; P3=false;P4=false;\r\nM=64;\r\nN=1;\r\nn=4000000;\r\nr=randi(255,1,n,'uint8');\r\n\r\nte=clock;\r\n r_repmatLV=repmatLV(r,M,N);\r\nt5=etime(clock,te)*1000;\r\nP5=isequal(r(1,n),r_repmatLV(M,n));\r\nassert(P5)\r\n\r\nfeval(@assignin,'caller','score',0);\r\nif P5\r\n sum_dt=min(15000,t1+t2+t3+t4+t5); % repmat scores 12000\r\n feval(@assignin,'caller','score',floor(sum_dt));\r\nend\r\n\r\nfprintf('Times: %.0f %.0f %.0f %.0f %.0f  Total %.0f msec\\n',t1,t2,t3,t4,t5,t1+t2+t3+t4+t5)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-08-25T20:11:30.000Z","updated_at":"2026-03-11T11:30:11.000Z","published_at":"2012-08-26T00:53:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe Challenge is to modify repmat.m to maintain all of its normal functionality and enhance its performance for large row replication for both N=1 and N\u0026gt;1 cases, B=repmat(A,M,N). The size of A for enhancement cases is [1,n].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor cases of M\u0026gt; 12,288,000 and n\u0026lt;128 or N*n\u0026lt;256 it is possible to perform an enhanced repmat in 40% of the time of repmat. The standard repmat takes 150% longer than repmatLV in certain cases on Cody (2.5 sec / 1 sec).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [A,M,N] standard input for repmat\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA: Vector (row or column) or an array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eM: row duplication factor of A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eN: column replication factor of A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e B, Array of size [M*m,N*n] where [m,n]=size(A)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eScore:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Performance is based upon time(msec) to execute four large row replications\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest Cases include normal arrays for which the function must still maintain repmat capability and also the large test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1: r [1,12] of uint32, M=6144000, N=4\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2: r [1,12] of uint8, M=6144000, N=16\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3: r [1,48] of uint32, M=6144000, N=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4: r [1,48] of uint8, M=12288000, N=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTest cases are sized to not hit the memory limit and clears are implemented.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePotential Path:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI suggest replicating repmat.m to a local folder and name it repmatLV.m. Create a shell that calls repmatLV as if it was repmat. Implement calls of the stressing test cases from the shell. Use the Profiler Tool to analyze where time is being consumed and devise alternative speed enhancements.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecommand window; open repmat\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efile: save as: to local folder with new name\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate Shell calling function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFrom the Editor/Shell; Tools: Open Profiler\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFrom Profiler Window: Start Profiling (Fourth row top left)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExplore the results of the profiler windows\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: The above cases assume a 3GB system or better. Reduce M as necessary.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe overall goal of this challenge is to show that matlab built-in functions are excellent resources for methods, optimization of functions is possible depending on individual needs, and profiling is fun.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA follow-up Challenge will demonstrate an optimization of ismember, for the 'sortrows' option with many rows, when both arrays have many rows vs columns and have low commonality(\u0026lt; 10%). Processing time can be reduced by more than 90% for these large row dominant arrays compared to the standard ismember time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEnjoy.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"open\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"open\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"open\"","","\"","open","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007effc556d5d0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007effc556d530\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007effc556cc70\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007effc556d850\u003e":1,"#\u003cMathWorks::Search::Field:0x00007effc556d7b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007effc556d710\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007effc556d670\u003e":"tag:\"open\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007effc556d670\u003e":"tag:\"open\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"open\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"open\"","","\"","open","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007effc556d5d0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007effc556d530\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007effc556cc70\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007effc556d850\u003e":1,"#\u003cMathWorks::Search::Field:0x00007effc556d7b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007effc556d710\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007effc556d670\u003e":"tag:\"open\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007effc556d670\u003e":"tag:\"open\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2997,"difficulty_rating":"easy"},{"id":925,"difficulty_rating":"easy"},{"id":921,"difficulty_rating":"easy-medium"}]}}