A résolu


Make the first letter of a sentence Capital.
In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You wi...

environ 4 ans il y a

A résolu


Eliminate redundant numbers in text
Occasionally someone might write text such as Briefly explain one (1) common problem that can result from the constant use of ...

environ 4 ans il y a

A résolu


Count unique orderings of vertices of a polygon
Cody Problem 2671 asks us to determine whether four points can be the corners of a rectangle. The points are not necessarily inp...

environ 4 ans il y a

A résolu


Determine the average number of rounds for the following game.
Each round a uniformly distributed random number is picked between 0 and 1. The game ends when the sum of the random numbers is ...

environ 4 ans il y a

A résolu


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

environ 4 ans il y a

A résolu


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

environ 4 ans il y a

A résolu


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

environ 4 ans il y a

A résolu


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

environ 4 ans il y a

A résolu


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

environ 4 ans il y a

A résolu


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

environ 4 ans il y a

A résolu


Compute the effective conductivity of a heterogeneous aquifer
Slow flow through soil or another porous medium follows Darcy’s law, which relates the flow of water to the gradient in piezome...

environ 4 ans il y a

A résolu


Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

environ 4 ans il y a

A résolu


MATLAB Basics: Complex Numbers
For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].

environ 4 ans il y a

A résolu


MATLAB Basics: Complex Conjugates
For a given complex number, x, return the complex conjugate, y.

environ 4 ans il y a

A résolu


MATLAB Basics: Complex Argument
For a given complex number, x, return the argument, y, in degrees.

environ 4 ans il y a

A résolu


Create a function that gives a matrix like the following
x=3 y= [1 -1 -1 0 1 -1 0 0 1]; -------------------------------- x=5 y= [ 1 -1 -...

environ 4 ans il y a

A résolu


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

environ 4 ans il y a

A résolu


Generate a matrix as follows
write a Function that gives like the following for a random n: n=2 ans= [ 0 1 1 0] n=6 ans= [ 0 ...

environ 4 ans il y a

A résolu


Draw a x-by-x matrix 'Denmark flag'(Euro(2020)
Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

environ 4 ans il y a

A résolu


Hoax Numbers
A Hoax Number (OEIS A019506) is defined as a composite number, whose sum of digits is equal to the sum of digits of its distinct...

environ 4 ans il y a

A résolu


Palindromic Prime
Palindromic Prime is a prime number that is also a palindromic number. (Wiki, OEIS) If given a monotonic series (increment=1) ...

environ 4 ans il y a

A résolu


Draw 'S'
draw S using nxn matrix, where n is odd and greater than 4 S = [1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 ...

environ 4 ans il y a

A résolu


Cancel Middle
Write a function called cancel_middle that takes A, an n-by-m matrix, as an input where both n and m are odd numbers an...

environ 4 ans il y a

A résolu


Double Fibonacci
double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the inpu...

environ 4 ans il y a

A résolu


Sort Except Zeros
Sort the numbers in a vector. But the position of zeros should not be changed. Example: sort_except_zeros( [5 3 0 0 2 4] ) == [...

environ 4 ans il y a

A résolu


Find the nth composite number.
Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...

environ 4 ans il y a

A résolu


Draw a x-by-x matrix British flag (Euro 2020)
Draw a x-by-x matrix 'British flag' using '0' and '1'.(x is odd and bigger than 4) x = 5 answer = [0 0 1 0 0 ...

environ 4 ans il y a

A résolu


Circular Segment Area
Let us consider a circle with radius . If we draw an angle (in radians) from the center of the circle, the two radii forming th...

environ 4 ans il y a

A résolu


Easy Sequences 10: Sum of Cumsums of Fibonacci Sequence
The function F(n) is defined as the set of Fibonacci numbers from the first up to the n-th. S(n) is the result of applying to F,...

environ 4 ans il y a

Charger plus