Community Profile

photo

reyhane mohebali


Active since 2018

Statistics

  • CUP Challenge Master
  • Commenter
  • Draw Letters
  • Solver

View badges

Content Feed

View by

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

mer än 5 år ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

mer än 5 år ago

Solved


Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

mer än 5 år ago

Solved


Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

mer än 5 år ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

mer än 5 år ago

Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

mer än 5 år ago

Solved


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

mer än 5 år ago

Solved


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

mer än 5 år ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

mer än 5 år ago

Solved


Add offset to a signal
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-offset-eqn.png>> You should see a downward...

mer än 5 år ago

Solved


Make a full wave rectifier
Produce a full wave rectifier waveform for the given sine wave source. For a sine wave input, the output of the full wave rec...

mer än 5 år ago

Solved


Produce a cosine wave
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>

mer än 5 år ago

Solved


Produce a sine wave
Produce a sine wave with amplitude 3: <<http://blogs.mathworks.com/images/seth/cody/sine-eqn.png>>

mer än 5 år ago

Solved


Add a block to a model
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-block-eqn.png>> In this case, the slope of...

mer än 5 år ago

Solved


Connect blocks in a model
Connect the blocks in the model to produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/connect-blocks...

mer än 5 år ago

Solved


Make a half wave rectifier
Produce a signal that outputs the given sine wave source when it is greater than zero and outputs zero when it is less than zero...

mer än 5 år ago

Solved


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

mer än 5 år ago

Solved


Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

mer än 5 år ago

Solved


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

mer än 5 år ago

Solved


Determine the number of odd integers in a vector
Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

mer än 5 år ago

Solved


02 - Vector Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of ...

mer än 5 å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 5 år ago

Solved


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...

mer än 5 år ago

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

mer än 5 år ago

Solved


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

mer än 5 år ago

Solved


行列内の素数の平均をとろう
行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。 例: 入力の行列が in = [ 8 3            5 9 ] のとき、 出力が 4 あるいは (3+5)/2 のようになり...

mer än 5 år ago

Solved


二つのベクトルの要素ごとの積の平均を計算しよう
二つの同じ長さのベクトルが与えられたとき、二つのベクトルの要素ごとの積の平均を求めましょう。 例: 二つのベクトル [1 2 3] と [10 15 20] が与えられたとき、 それぞれの要素ごとの積の平均を取ると、 解は 33.33...

mer än 5 år ago

Solved


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

mer än 5 år ago

Solved


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

mer än 5 år ago

Solved


チェッカーボードを作ろう
整数 n が与えられた時、以下の様な1と0を含むn×nの行列を作成しましょう。a(1,1) は1にする必要があります。 例: 入力 n = 5 出力 a が [1 0 1 0 1 0 1 0 1 0 ...

mer än 5 år ago

Load more