Solved


A sequence of Ones
You are given number(s) with all digits - 1. Your answer will depend on the count of 1 in the given number, for example - x1...

11 months ago

Solved


adding huge numbers
Write function called huge_add that adds together two positive integers of any length specified as char vectors using decimal n...

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

11 months ago

Solved


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

11 months ago

Solved


Highly divisible triangular number (inspired by Project Euler 12)
Triangular numbers can be calculated by the sum from 1 to n. For example, the first 10 triangular numbers are: 1, 3, 6, 10, ...

11 months ago

Solved


ABBREVIATION
Abbreviate the given string. Consider Only Capital Letters. EXAMPLE If input is 'Abbreviation of The Given String' then ou...

11 months ago

Solved


JOIN STRINGS
There are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQU...

11 months ago

Solved


COUNT LETTERS
Count the number of letters in a given string. For Example: STR='The MAtlAb code'; output:T 2 H 1 E 2 M 1 A 2 L 1 B 1 C 1 O 1 D ...

11 months ago

Solved


Decrypt Polybius
Decrypt Polybius square. Please refer to Problem 1150 Polybius Square. input [13 33 14 51] output 'cody'; input [23 0 26 33 4...

11 months ago

Solved


Polybius Square
Given a string, calculate the coordinates. Input will be always in lowercase. If string is a sentence then use 0 (zero) to indic...

11 months ago

Solved


Bleed non-zeros to the right
What a title! Yet, it says what I mean. You get a vector, some values and a lot of zeroes. Every zero is replaced by the firs...

11 months ago

Solved


Dice face matrix!
This is dice simulator, but instead of making a random die number, you will receive an "pre-rolled" number in and spit out a mat...

11 months ago

Solved


Reindex a vector (★★)
(copy of Prob. 676) You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX h...

11 months ago

Solved


'X'avier
Given a square matrix A of size n, write a function to create a new matrix B where only the elements on the main diagonal and th...

11 months ago

Solved


Moyenne pondérée
Ecrire une fonction qui prend en entrée un vecteur P et un vecteur V et calcule la moyenne pondérée MP des élements vi d'un vec...

11 months ago

Solved


sum of binomial series

11 months ago

Solved


State of Charge (SoC) Estimation for a Battery
The State of Charge (SoC) of a battery represents its remaining charge as a percentage. It can be calculated using the formula: ...

11 months ago

Solved


Voltage Divider Calculation
A voltage divider is a simple circuit used to obtain a reduced voltage from a higher voltage source using two resistors in serie...

11 months ago

Solved


Error handling
If the input is a negative number, generate an error. Otherwise, return the number.

11 months ago

Solved


Poly2mask, drawpolygon or patch
Recently, I tried to plot a polygon in matlab, and I found there is a lot of embedded function that can be used. However, some f...

11 months ago

Solved


Find the triplet
Given an array x of size n > 3 and an integer N, return the indices of three elements in the array that sum up to the given inte...

11 months ago

Solved


Find Next Strictly Greater Element
Given an array of numbers, create a new array where each element represents the next strictly greater element to the right of th...

11 months ago

Solved


create a square matrix
create a [n*n] matrix. example: mat(4)= [ 1 4 9 16 4 4 9 16 9 9 ...

11 months ago

Solved


Basic Mathematics 6
A High School is trying to build their robot to be able to reach the hanging object which is H inches from the ground. Their ro...

11 months ago

Solved


Return part of an array
Given a 5x5 array, return a 3x3 array that contains the cells that are not on the edge of the array: Given this array Return...

11 months ago

Solved


Add Odd and Subtract Even Numbers in an Array
For an input array, add all the odd values and subtract the even values. The final value is the output. E.g. input = [1 2 3 4 ...

11 months ago

Solved


Write script that gives matrix like the following example:)
if x=2; y=[2 1; 1 1] if x=4; y=[4 3 2 1 3 3 2 1 0 2 2 1 0 0 1 1] if x=5; y=[5 4 3 2 ...

11 months ago

Solved


Chicken Race
2 chickens, Pete and Fred, compete in a 100 meter race. Pete runs at a velocity of vp meter/second and Fred is slower, running ...

11 months ago

Solved


Reduce the logic
We have three logical input, x,y and z. The output is: y = ((x&y)|z)&((z|x&y)|(z&y|x))|((x&z)|z)&((y|x&z)|(z&x|y))|(x|y|z) ...

11 months ago

Load more