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

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

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

5 months ago

Solved


sum of binomial series

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

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

5 months ago

Solved


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

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

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

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

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

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

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

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

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

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

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

5 months ago

Solved


make histogram
You probably know the function hist(x,n) to get the histogram. Now try to write the function yourself! For the cheaters wanting...

5 months ago

Solved


Creating a code via test suite :)
Given the test suites, create a code that would fit them :) *Clue: Pascal's Triangle

5 months ago

Solved


ICFP 2024 Programming Contest June 28 thru July 1
This is to announce the annual ICFP programming contest for 2024. The ICFP 2024 homepage link is ICFP 2024 . Registration will...

5 months ago

Solved


How many points lie within the rectangle and how many aren't?
Suppose, you are given the coordinates of bottom-left and top-right corners of a rectangle as *input-1, R* i.e *R=[Bottom-left c...

5 months ago

Solved


Convert integers from primary notation to base 10
The primary system of expressing numbers has three digits: m, x, and p, which correspond to -1, 0, and 1. The places in a primar...

5 months ago

Solved


Latest Question On Cody
Get the problem number of the latest submitted Problem on Cody. Copying the test suite code might not help.

5 months ago

Solved


Cell Operator *
Please implement operator * for cell: >> {2,3} * 2 ans = 1×4 cell array [2] [3] [2] [3] >> {2,3} * [2 3]...

6 months ago

Solved


Dice roll - lateral faces
For this problem, you will be provided with the values of a dice roll (regular six-sided dice). The number of dice will be at le...

6 months ago

Solved


01-01: 正弦波の生成
「MATLABで学ぶ実践画像・音声処理入門」のプログラム1-1 と同じ正弦波を、サンプリング周波数 10kHz で生成し、返却する関数を作成せよ。

6 months ago

Solved


Mandelbrot Number Test [Real+Imaginary]
The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

6 months ago

Solved


Usage of varargout
This Challenge is to demonstrate usage of varargout. Output a cell array using varargout of magic squares of size 1 thru n. ...

6 months ago

Solved


Exponentiation
Given 3 integers b,e,k; find -- mod(b^e,k)

6 months ago

Load more