Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...
8ヶ月 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
8ヶ月 前
解決済み
Flipping
Write code that can reverse the vector without using any sort of loop.
Example
Given the input vector
A = [ 1 2 3 4 5...
8ヶ月 前
解決済み
Half-Swap
Given a vector with an even number of elements,
rearrange it so that the elements in its first
half are switched with those i...
8ヶ月 前
解決済み
Find the Oldest Person in a Room
Given two input vectors:
* |name| - user last names
* |age| - corresponding age of the person
Return the name of the ol...
8ヶ月 前
解決済み
Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example
start with x = 1 and y = 3
end with y = 1 and x = 3
Do NOT simply r...
8ヶ月 前
解決済み
Flipping a Matrix
Flipping matrix up and down.
If a central row is exists, leave it, and flip remaining rows.
Example
Mat = magic(3)
...
8ヶ月 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...
8ヶ月 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
8ヶ月 前
解決済み
Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector of numbers, output a square array with the...