Square a Number
Given an input x, return y, which is equal to the square of x.
約1年 前
解決済み
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
linear least squares fitting
Inputs:
* |f|: cell-array of function handles
* |x|: column vector of |x| values
* |y|: column vector of |y| values, same l...
Implement a ROT13 cipher
Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...
Binary Coder
Take an input number and print the binary value of this number.
約1年 前
解決済み
Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition.
Examples
Previo...
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
約1年 前
解決済み
sum of non-primes
The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38
Find the sum of all the positive non-prime integers that do no...
約1年 前
解決済み
subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.
約1年 前
解決済み
Nilpotent matrix
Check if matrix A is
<http://mathworks.com/ nilpotent>.