Solved

Calculate the square of a number (Super Easy)

The goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.

8 months ago

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

8 months ago

Solved

Add consecutive integer numbers

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

8 months ago

Solved

Cannibal eating odd and even numbered men

There are N men in a queue. A cannibal eats either all odd-numbered or all even-numbered men in the queue at a time. In the fi...

9 months ago

Solved

Muphry's Law of MATLAB

You're running some simple multiplication problems through MATLAB for error checking purposes, but nothing seems to come up with...

10 months ago

Problem

Lunar Arithmetic (Multiplication)

<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit when adding and take ...

10 months ago | 3

Problem

Lunar Arithmetic (Addition)

<https://oeis.org/A087061 OEIS link for a description of lunar arithmetic> Simply take the larger digit. Example 1: ...

10 months ago | 0

Solved

Sum of unique multiples of 3 and 5

If we list all the natural numbers up to 15 that are multiples of 3 or 5, we get 3, 5, 6, 9, 10, 12 and 15. The sum of these mul...

11 months ago

Solved

count upper and lower case characters

In a given input string, count and return the number of upper and lower case characters as u and l respectively. For example:...

11 months ago

Solved

Raise each element to the power of its index in a matrix

In a matrix, A = [1,2;3,4] raise the power of each element like: 1^1+2^3+3^2+4^4 and add it all to produce the result 274

11 months ago

Solved

Exponents in Factorials

It's time to get excited about numbers!!! Well, we're just dealing with factorials here, but it's still a good reason to get ex...

11 months ago

Solved

Amicable numbers

Test whether two numbers are <https://en.wikipedia.org/wiki/Amicable_numbers amicable>, meaning that the sum of the proper divis...

11 months ago

Solved

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

11 months ago

Solved

New Matrix with vector addition on diagonal

consider 2 vectors x=[1 2 3] y=[4 5 6] then generate a new Matrix, where Addition of x & y will be diagonal Elements...

12 months ago

Solved

Reverse the Matrix

Given a Matrix A, reverse it. Such that, last element of A becomes 1st and vice versa. for example: Input = [1 2 3;4 5 ...

12 months ago

Solved

Return all matrix elements except elements on diagonal

Consider a given Matrix A=[a b c; d e f; g h i] then return a row vector T such that it contains all the El...

12 months ago

Solved

Transpose the Matrix

Transpose the given matrix, e.g. x=[a b;c d] transpose of x = [a c;b d]

12 months ago

Solved

Get the combinations

Consider p,q = 2 vectors of same or different length. Get a Output Array which has all the possible combinations of Elements o...

12 months ago

Solved

Find the Pattern

Find the pattern between input and output. Write a function that gives the correct output for any input. *Hint: magic*

1 year ago

Solved

Large Sum (inspired by Project Euler 13)

Your function will be provided an arbitrary number of numbers of arbitrary sizes as a cell array of strings. Some numbers will b...

1 year ago

Solved

how many of the entries are positive?

Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

1 year ago

Solved

The Deadly Sin

Melvyn and Banner are fighting over chocolates. Melvyn has X chocolates, while Banner has Y. Whoever has a lesser number of choc...

1 year ago

Solved

Counting Squares

An algorithm starts with a single square and on each of its next iterations adds new squares all around the outside as shown bel...

1 year ago

Solved

Seperate array to small section according to its index position

Given a integer n, we can generate a sequence [0,1,2,3,4,..., 2^n-1], then we separate it to two sequence according to their ind...

1 year ago

Solved

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.

1 year ago

Solved

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

1 year ago

Solved

Five Fingers

A little girl has just learnt how to count from 1 to N using the five fingers of her left hand as follows. She starts by calling...

1 year ago

Solved

Calculate the h-index

H-index is a powerful tool for quantifying the scientific contribution of a researcher. H-index is defined as follows (source - ...

1 year ago

Solved

determine the sum of fraction part for given matrix

determine the sum of fraction part for given matrix a=1.8308 8.9172 6.7537 1.5853 10.2858 5.3804 6.5497 ...

1 year ago