Community Profile

# Minh Tan Trinh

Last seen: 7 månader ago Active since 2021

#### Content Feed

View by

Solved

Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

mer än ett år ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

mer än ett år ago

Solved

Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

mer än ett år ago

Solved

Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

mer än ett år ago

Solved

Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

mer än ett år ago

Solved

Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

mer än ett år ago

Solved

Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

mer än ett år ago

Solved

Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

mer än ett år ago

Solved

Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

mer än ett år ago

Solved

Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

mer än ett år ago

Solved

There are 10 types of people in the world
Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

mer än ett år ago

Solved

Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector). Example: Inpu...

mer än ett år ago

Solved

Relative ratio of "1" in binary number
Input(n) is positive integer number Output(r) is (number of "1" in binary input) / (number of bits). Example: * n=0; r=...

mer än ett år ago

Solved

Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

mer än ett år ago

Solved

Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

mer än ett år ago

Solved

Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

mer än ett år ago

Solved

Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

mer än ett år ago

Solved

Converting binary to decimals
Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

mer än ett år ago

Solved

Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

mer än ett år ago

Solved

Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

mer än ett år ago

Solved

サイコロを作ろう
1から6までの独立かつランダムな数値を返すような関数を作成しましょう。 例： >> [x1,x2] = rollDice(); と入力すると x1 = 5 x2 = 2 のような解を返します。

mer än ett år ago

Solved

チェッカーボードを作ろう

mer än ett år ago

Solved

ベクトルの値が増加しているかを調べよう
ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。 例: 入力が x = [-3 0 7] のとき、 関数の...

mer än ett år ago

Solved

ある数のベクトルが与えられた場合、そのベクトルの要素の一つが他の要素の二乗であれば true を返し、それ以外の場合は false を返すようなコードを書いてみましょう。 例: 入力が a = [2 3 4] のとき、 出力 b は t...

mer än ett år ago

Solved

mer än ett år ago

Solved

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

mer än ett år ago

Solved

mer än ett år ago

Solved

ゼロでない要素が一番多い行を探そう

mer än ett år ago

Solved

ベクトル b にあるスカラ値 a が含まれていれば出力として 1 を返し、含まれていなければ 0 を返すような関数を作成しましょう。 例: a = 3; b = [1,2,4]; スカラ値 3 はベクトル b に含まれていない...

mer än ett år ago

Solved

NaN (欠損値) が含まれている行を削除しよう

mer än ett år ago