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.

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

7달 ago

Solved

Add consecutive integer numbers

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

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

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

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

9달 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: ...

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

10달 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:...

10달 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

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

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

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

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

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

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

11달 ago

Solved

Transpose the Matrix

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

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

11달 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*

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

12달 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년 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년 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년 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년 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년 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년 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년 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년 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년 ago