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...
1년 초과 전
문제를 풀었습니다
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...
1년 초과 전
문제를 풀었습니다
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...
1년 초과 전
문제를 풀었습니다
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
1년 초과 전
문제를 풀었습니다
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
1년 초과 전
문제를 풀었습니다
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
1년 초과 전
문제를 풀었습니다
Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example:
[q,r] = swap(5,10)
returns q = ...