Problem 2631. Flip the vector from right to left
Solution Stats
Problem Comments
-
14 Comments
Try out this problem
Try Out this cody questions...
How can we do for last test case.
Can any one help me out?
how to solve below test case
%%
code = fileread('flip_vector.m');
assert(isempty(strfind(code, 'fliplr')));
Nice tricky problem
y=x(end:-1:1) I think this might help
You cannot pass the last test suite if you use the function fliplr
flipud(x')'
... didn't say anything about allowing flipud!
pretty simple
code = fileread('flip_vector.m');
assert(isempty(strfind(code, 'fliplr')));
Assertion failed.
Can anyone give me idea what is 'flip_vector.m' here?
@Ankit Meena,
'flip_vector.m' is the function file for the solution code submitted.
"code = fileread('flip_vector.m'); " -> This line of code is used to obtain the contents of your solution as a text file. And the next line of code checks for any requirement.
You can check that the first line in your solution will be -
function output = flip_vector(input)
(output and input being placeholders)
I hope this answers your question.
Nice problem
Nice problem!
Not using Matlab dedicated function to this should be written in the problem statements. I dislike this kind of "twist". Nonsense.
@Nicolas, It IS written in the problem statement -
"Request not to use direct function."
Solution Comments
Show commentsProblem Recent Solvers10577
Suggested Problems
-
2460 Solvers
-
Remove the polynomials that have positive real elements of their roots.
1737 Solvers
-
Implement simple rotation cypher
1091 Solvers
-
1101 Solvers
-
Solve a System of Linear Equations
14035 Solvers
More from this Author70
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!