Adjoint matrix
given a matrix a, find the adjoint matrix of a.
5年以上 前
解決済み
Find a common vertex
First input is T, a triplet list of indices. Second input is i, a single index (positive integer). The goal of this function is ...
5年以上 前
解決済み
Find a common edge
First input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct int...
5年以上 前
解決済み
SAY 'OHYEAH'
Regardless of input, output the string 'OHYEAH'.
5年以上 前
解決済み
Check prime numbers
Let x, return 1 if x is a prime number, 0 otherwise
e.g x = 7, return y =1;
x = 6 return y = 0;
Angle between two vectors
Given 2 pairs of _cartesian co-ordinates_, determine the angle between the 2 vectors formed by the _points_ and the _origin_. An...
5年以上 前
解決済み
Find The Difference
Vector x is given.calculate the difference between the biggest and the smallest number that we can create from elements of x.
f...
You never ask a lady her age
Instead you ask her to multiply her age by 10, then subtract any of the first nine multiples of 9 (9,18,...,81), and tell you th...
5年以上 前
解決済み
Pass the Threshold!!
Write a Matlab function that will take as input a matrix of arbitrary dimensions and a
scalar threshold value, and return a vec...
5年以上 前
解決済み
Find argmax of a function
You are given vectors x and y (=f(x)).
Return the element of x for which f(x) is maximized.
Find the position of planet in solarsystem
Write a funtion named *nthplanet* which takes name of the planet as input string and provides the position of the planet, starti...
5年以上 前
解決済み
sumdigits
function [p1,p2] = goldbach(n)
for p1 = 1:n
if isprime(p1)
p2 = n - p1;
if isprime(p2)
re...
Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody.
Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...