Write c^3 as sum of two squares a^2+b^2
write c^3 as sum of two squares a^2+b^2. a and b must be integer and greater than zero.
For example
5^3 = 2^2 + 11^2
5...
Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise
3年弱 前
解決済み
Back to basics 11 - Max Integer
Covering some basic topics I haven't seen elsewhere on Cody.
Return the largest positive integer MATLAB can handle.
3年弱 前
解決済み
Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix
Grades=[98 56 34 100 88 87]
**re...
3年弱 前
解決済み
Sum of first n positive integers
Given n, find the sum of first n positive integers
Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these terms is 55
Replacing a row
For matrix G=[1 2 3; 4 5 6; 7 8 9]
Replace the 2nd row with 8s
**remember to create matrix G
3年弱 前
解決済み
Building matrices
If you have matrix A, create matrix B using matrix A as an "element"
A = [1 2 3 4;
5 6 7 8...
3年弱 前
解決済み
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
3年弱 前
解決済み
Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.
3年弱 前
解決済み
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
3年弱 前
解決済み
BASICS - sum part of vector
Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum.
Examp...
3年弱 前
解決済み
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below.
...