Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 289938

Submitted on 26 Jul 2013 by Alfonso Nieto-Castanon

Correct

10Size
This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
n = ceil(100*rand());
v = rand(1,n);
v_correct = v';
assert(isequal(question(v),v_correct));
[Warning: Function /users/msssystem14/assert.m has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.]
[> In question at 2
  In verifyCode>evaluateCode at 227
  In verifyCode at 40
  In fevalJSON at 14
  In workspacefunc at 7]
2
Pass
 
%%
fid = fopen('question.m');
line1=fgetl(fid);
line2=fgetl(fid);
line3=fgetl(fid);
fclose(fid);
assert(strcmp('function myAns = question(v)',line1),'Only change the lines you are asked to');
assert(strcmp('  %%%%%',line2),'Only change the lines you are asked to');
assert(strcmp('  %%%%% Place your code below. DO NOT change anything outside the region %%%%',line3),'Only change the lines you are asked to');