A résolu


Easy Sequences 99: One-line Code Challenge - Real Digitizer
Given a real number r, write the function rDigitizer that breaks r into constituent digits and symbols. For example: >> ...

environ 2 mois il y a

A résolu


Easy Sequences 98: One-line Code Challenge - Ternary Operator Function
Ternary operation is a standard construct in most computer languages. The ternary operator assigns value to a variable depending...

environ 2 mois il y a

A résolu


Sequence problem
find the nth term of the sequence: 790 1303 2033 ____ 4366 6095

environ 2 mois il y a

A résolu


Easy Sequences 96: One-line Code Challenge - Polynomial Folding Function
The Matlab fold function is a very useful functional programming construct. Unfortunatlely, fold is not available io Cody player...

environ 2 mois il y a

A résolu


The Yellowstone Permutation
The Yellowstone Permutation is a sequence of positive integers, defined by the following rules: No term is repeated. Given n t...

environ 2 mois il y a

A résolu


About jokes (and compression)
An argument can be made about jokes. The shorter they are, the funnier. Further explained here: https://en.wikipedia.org/wiki/Hu...

environ 2 mois il y a

A résolu


Repeat a string (not a character array)
True string are a relatively recent addition to MATLAB, first having been available in R2016. Strings contrast with character ar...

environ 2 mois il y a

A résolu


Easy Sequences 95: LCM Sums
For a given , write the function lcmSum(n), defined as follows: For example for : >> lcmSum = @(n) sum...

environ 2 mois il y a

A résolu


The rabbit problem
Suppose a newly-born pair of rabbits, one male, one female, are put in a field. Rabbits are able to mate at the age of one month...

environ 2 mois il y a

A résolu


Easy Sequences 94: GCD Sums
Given positive integer , write the function gSum(x), that sums all the GCD's of the integer pairs . For example in the Excel scr...

environ 2 mois il y a

A résolu


Compare a value to a vector
Given a random value X and a random vector Y. you have to compare X to the Vector Y and make a decision. case 1: X is a value i...

environ 2 mois il y a

A résolu


Easy Sequences 92: Number of Roots of a System of Linear Diophantine Equations
One of the tasks that Matlab is very good at, is in solving systems of linear equations. In this problem we shall tackle a sys...

environ 2 mois il y a

A résolu


Knight Moves?
One of my favorite games are chess. Let’s do something with chess. If you don’t know chess, that’s completely fine. You can stil...

environ 2 mois il y a

A résolu


Easy Sequences 93: Recursive Polynomial Function
For a natural number and a polynomial function , we define a recursive function , as follows: , and ...

environ 2 mois il y a

A résolu


Generate Hadamard Matrix without using hadamard function
In mathematics, a Hadamard matrix, named after the French mathematician Jacques Hadamard, is a square matrix whose entries are e...

environ 2 mois il y a

A résolu


Median filter over three values
Implement 1-D median filter over input vector x as described: Moving window size is 3 Output is middle/central value in moving...

environ 2 mois il y a

A résolu


Compute the average precipitation for a watershed using the Thiessen polygon method
Several methods are available for estimating the average precipitation for a watershed from a few observations at rain gauges. T...

environ 2 mois il y a

A résolu


Compute frequency factors for the normal distribution
In frequency analysis in hydrology, the streamflow corresponding to a specified exceedance probability (or return period ) can...

environ 2 mois il y a

A résolu


Counting Permutations
In the permutations of the numbers 1 to n, count the number of permutations in which exactly m elements are greater than the pre...

environ 2 mois il y a

A résolu


Determine flows of given probability using empirical frequency analysis
Write a function that takes as input observations of peak streamflow and exceedance probabilities expressed as percentages an...

environ 2 mois il y a

A résolu


Extract the prime numbers
Given a list of elements, extract the prime numbers from that array.

environ 2 mois il y a

A résolu


Find alternating sum
Given an array, find alternating sum i.e. – y = x (1) – x (2) + x (3) – x (4) + x (5) - …

environ 2 mois il y a

A résolu


Play with array Min-Max
An array is provided. For example, a= [ 2,1,11,4,5,13] Create an array from a like this way, out= [ 1,11,2,13,4,5] ➢ 1st take...

environ 2 mois il y a

A résolu


Given a matrix X, manipulate it accordingly
Given a matrix X, 1st add a column to the matrix whose elements are the summation of each rows. Then add a row to the matrix who...

environ 2 mois il y a

A résolu


An array is given. Find the unique elements of the array. [keep the sequence unchanged]
An array is given. Find the unique elements of the array. [keep the sequence unchanged] For example if input x=[2 ,4 , 9 ,2 ,...

environ 2 mois il y a

A résolu


An array is given that contains the marks. Find out the highest 3 marks
An array is given that contains the marks received by a group of students in their class test. Find out the highest 3 marks rec...

environ 2 mois il y a

A résolu


Easy Sequences 91: Generalized McCarthy-91 Recursive Function
The McCarthy 91 function is a recursive function, defined by the computer scientist John McCarthy as a test case for formal veri...

environ 2 mois il y a

A résolu


Compute the area of the shoemaker’s knife
A shape resembling a shoemaker’s knife is constructed from a semicircle with diameter with two semicircular “bites” of diameter...

environ 2 mois il y a

A résolu


Integer vector optimal lossless deduplication
You're given an integer vector A, a Min scalar and a Max scalar. You can assume all elements in A are in [Min,Max] range, and nu...

environ 2 mois il y a

A résolu


Repeatitive Summation
Given numeric vectors x, a and b, perform the following operation - a represents a vector of numbers and b represents a vector ...

environ 2 mois il y a

Charger plus