已解决


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

1 month 前

已解决


Convert vector of strings to lower triangular matrix
Given a non-empty vector vec of strings, please put its elements into the lower triangular half of a square matrix M column-wise...

1 month 前

已解决


Kurchan 4x4 - Optimal score
Related to Problem 1646, but bigger. Technically, all you need to do for this Cody problem is input a 4x4 matrix containing the...

1 month 前

已解决


Kurchan 5x5 - Optimal Score
Related to Problems 1646 and 2650, but bigger. Technically, all you need to do for this Cody problem is input a 5x5 matrix conta...

1 month 前

已解决


Check Digit - 02
Given a list of ISBN's, check whether they're valid or not. Prev Prob - <https://www.mathworks.com/matlabcentral/cody/problem...

1 month 前

已解决


Check Digit - 01
The International Standard Book Number (ISBN) is a numeric commercial book identifier that is intended to be unique. It used ...

1 month 前

已解决


Symmetric Pair
Given an (n, 2) matrix, remove any symmetric pairs from the matrix. Keep the first occurrence. (2, 3) and (3, 2) are considere...

1 month 前

已解决


another bullseye
create matrix like below -- for x=2, y=[1 1 1 1 1; 1 2 2 2 1; 1 2 3...

1 month 前

已解决


Pixel density
<https://en.wikipedia.org/wiki/Pixel_density Pixel density> tells us how many pixels we can find within a unit of length. And a...

2 months 前

已解决


Doubling elements in a vector (★★)
(copy of prob. 1024) Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] t...

2 months 前

已解决


Generate binary combinations for a given number of bit(s)
Generate the binary combination as in the example below. Example: If you are given: bin_comb(2) The answer will be: ...

2 months 前

已解决


The Ulam Matrix
The Ulam spiral is simple to describe. On a gridded piece of paper, write down the number 1. Then write successive integers as y...

2 months 前

已解决


Find the index of the first occurrence of a value in a matrix
Given a matrix of scalars, find the first occurrence of -1 in each column. Output NaN for a column which does not contain the va...

2 months 前

已解决


Enclosure Matrix
The problem gives you a positive integer n. You need to create a matrix consisting of n layers of natural numbers; the outermost...

2 months 前

已解决


Rewrite setdiff to account for non-unique values
Setdiff(a,b) is a function that will remove all values of b from a. Sometimes, you need this function to do a little bit extra,...

2 months 前

已解决


Mo money, mo math #2! (★★★)
(adapted from Prob 9 Cody team) You have a matrix for which each row is a person and the columns represent the number of quar...

2 months 前

已解决


COUNT VOWEL 2
The objective of this problem is to determine the number of unique vowels used in the given string. Now count vowels in STRI...

2 months 前

已解决


Remove duplicated triangles
Input T is a triangulation (triplet list of indices -positive integers-, each index refering to a vertex number in a correspondi...

2 months 前

已解决


Draw Dominos
Write a function to draw dominos. The number on each side can range from 0 to 9. For example, for an input of [3,7], your functi...

2 months 前

已解决


Create Truth Table of Size according to input
Create a Truth Table Example: n = 3 output = [0 0 0; 0 0 1; 0 1 0; 0 1 1; 1 0 0; 1 0 1; 1 1 0; 1 1 1]

2 months 前

已解决


Writing Error Messages
Well written functions check inputs to make sure the input is valid. The function ErrorCheck takes three arguments: * a - a s...

2 months 前

已解决


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

2 months 前

已解决


Calculate the height of an object dropped from the sky
Assume that an object is dropped from 1000 meters above the surface of the earth at time t=0. The object is dropped such that t...

2 months 前

已解决


Keep Only Even Numbers
Given a vector, return a new vector containing only the even numbers in their original order. Example: keep_evens([1 2 3 4 5 6])...

2 months 前

已解决


Redefine the Array if the Elements in the Array are Repeating
Check if the Array has any repeating elements, if there are repeating elements then choose "n" as a number of times you want tha...

2 months 前

已解决


Weird Diagonal Matrix!!
**If you have loved the problem, please like it below(Request)** Given an integer n, create a matrix whose diagonal elements wi...

2 months 前

已解决


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

2 months 前

已解决


Find the next binary palindrome number
We all know, a *palindrome* is nothing but a number or character which remains the same after the forward or backward alteration...

2 months 前

已解决


Suma de Gauss
¿Cuál es la suma de los primeros enteros positivos?

2 months 前

已解决


Binary Coder
Take an input number and print the binary value of this number.

2 months 前

加载更多