Problem 2971. square a vector-Given the variable x as your input, square it and put the result in y.
function y = (x)squared
y = x; end
Solution Stats
Problem Comments
-
1 Comment
Matthew Eicholtz
on 7 Feb 2015
I suggest looking at more Cody examples to understand the structure of the problem statement, function definition, and test suite.
Solution Comments
Show commentsProblem Recent Solvers109
Suggested Problems
-
Who knows the last digit of pi?
671 Solvers
-
Flip the main diagonal of a matrix
828 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
382 Solvers
-
Matlab Basics II - Count rows in a matrix
381 Solvers
-
303 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!