Community Profile

# Tim

1 283 total contributions since 2012

View all

Contributions in
View by

Solved

Find the centre of an arc and its radius
Given two points on an arc (x0,y0) and (x1,y1) and the angle between them, alpha. Return the centre of the circle and the rad...

17 dagar ago

Solved

Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.
Given a matrix x, *using loops only* return a matrix y, in which all the zeros have "climbed" up to the top. That is, any zeros ...

27 dagar ago

Solved

Pascal's Equilateral triangle inside a Matrix!!!
Given a number of row 'n', generate the following pascal's matrix 'p' where spaces are filled by 'zeros'. number of row, n = ...

28 dagar ago

Solved

Invert a 3D rigid-body transformation
Given an SE(3) matrix representing a rigid-body motion, compute its inverse without using |inv()| or |pinv()| .

Solved

Create a 3D rotation matrix from roll-pitch-yaw angles
Consider a robotics application where the world reference coordinate frame {W} and a robot manipulator arm with an attached tool...

Solved

Parsing Expressions - Binary Arithmetic Operators I
Parse and evaluate expressions like these: '1 + 2' '51 - 78' '42 * 9' The only operators are +, -, *. Both argu...

Solved

Given a matrix A return a vector of the product of the elements in each column using a loop without using prod.
--------------------- for m: 3 1 3 3 10 1 9 1 9 4 1 4 5 6 5 ...

Solved

Invert a 3D rotation matrix
Given a 3D rotation matrix, belonging to the matrix group SO(3), compute its inverse without using the functions |inv()| or |pin...

Solved

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...

Solved

Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

Solved

Sum of a geometric series
Give the sum of the first 'n' terms of a geometric series, given 'a' as the first term and 'r' as the ratio.

Solved

Permutation Via Multiplication
Given two numbers a and b, determine if the product ab is a permutation of the digits of a. For example, this is always true for...

Solved

Alternating 1´s and 0´s in a matrix
Given an odd number n, write a function that creates a matrix y with dimension nxn alternating 1's and 0's, and starting with 1 ...

Solved

Mean number of letters per word (Easy)
Given a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the give...

Solved

Given a base n, find the y values less or equal than 100, such that they will never produce a periodic number if we divide any whole number between some of them
A periodic number depends on the base b where we are working. So, for example the number 2/3 in decimal base is periodic(0.666...

Solved

Just another norm problem (JANP)
*Task:* Implement a function that takes a square matrix A and returns a nonzero vector yc which minimizes ...

Solved

How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

Solved

Cody problems in French : Trouvez la logique Pt.2
Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage. P.S: L'utilisation de "^" est de nouveau fortement...

Solved

Double the next!
Given two numbers, m and n, find a matrix m x n where each element value is twice the value of the previous element. Starting fr...

Solved

Iccanobif numbers 1
There are a lot of problems in Cody that deal with Fibonacci numbers (1, 1, 2, 3, 5, 8, 13, 21 etc...) so let's turn things arou...

Solved

Generate Convolution Matrix of 2D Kernel with Different Convolution Shapes (Full, Same, Valid)
In this problem the challenge is to build the Matrix Form equivalent of the function `conv2()` of MATLAB. The function to be ...

Solved

Word Distance - Average Sort
Based on the method of <https://www.mathworks.com/matlabcentral/cody/problems/44815-word-distance-sum this problem>, write a fun...

Solved

Scalar Matrix Manipulation
Assume, input x is a scalar matrix such as, x = 2 0 0 0 2 0 0 0 2 th...

Solved

Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

Solved

Wrecked Angles?
It's time for some simple geometry fun to start off the new year. You will be given the perimeter P and the area A of a recta...

Solved

Find the complement of a number in binary
Input x is a decimal number and output y is the complement of binary representation of x. For example, x = 10 has the binary ...

Solved

Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...

Solved

Optimization of cylinder surface area
Optimization of a cylinder surface area. What are the best parameters (radius and height) to get the minimum cylinder surface a...

Solved

Project Euler 249: Prime Subset Sums
Inspired by Problem 249 of Project Euler. <https://projecteuler.net/problem=249> Let S = {2, 3, 5, ...} be the set of prime ...