Conditional transpose - MATLAB Cody - MATLAB Central

Problem 60734. Conditional transpose

You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has the same "rowishness" as x: y should be a row vector if x is a row vector, and a column vector if x is a column vector.
Control flow statements (if, switch, for, while, try) and recursion aren't allowed. Neither are arrayfun and friends (cellfun, structfun, varfun, rowfun, spfun). Cheating is possible but made harder, and in any case discouraged.

Solution Stats

63.16% Correct | 36.84% Incorrect
Last Solution submitted on May 14, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers11

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!