Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 years ago

Solved

Make a random, non-repeating vector.

This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

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

2 years ago

Solved

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

2 years ago

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4

Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

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

2 years ago

Solved

2倍してみよう - ここからスタート！

初めにこの問題を試してみよう。 入力としてxを与え、それを2倍して結果をyに代入せよ。 Examples: Input x = 2 Output y is 4 Input x = 17 Output y is 34 ...

2 years ago

Solved

give nth decimal place of pi

max 15th place after the decimal point is ok for now

3 years ago

Solved

Back to basics 21 - Matrix replicating

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

3 years ago

Solved

Finding fourier transform of a given vector

Find the fourier transform of a given input vector for ex a=[1 2 3 4] then y=[ 10.0000 + 0.0000i -2.0000 +...

3 years ago

Solved

Calculate the number of elements in a matrix.

Calculate the number of elements in a matrix.

3 years ago

Solved

Initialize a Natural Number matrix.

Given length of matrix initialize a matrix consisting of natural numbers from 1 to n: n = 10; x = [ 1 2 3 4 5 6 7 8 9 10]; ...

3 years ago

Solved

My Problem, Find the square of the horizontal concatenation of the third and fifth elements of a vector.

given the 1x5 vector x, y must be the square of the horizontal concatenation of the third and fifth elements. So, if x = [1 1 1 ...

3 years ago

Solved

Reverse CHECKBOX MATRIX with 69

Create a reverse checkbox matrix with '69'. Where the size is the input and output will be a square checkbox matrix. Exa...

3 years ago

Solved

Remove and Sort

Given a randomized array n, sort it and remove all odd integers. n=5 y = [2 4]

3 years ago

Solved

Flipping a Matrix

Flipping matrix up and down. If a central row is exists, leave it, and flip remaining rows. Example Mat = magic(3) ...

3 years ago

Solved

Add one raw in given matrix as shown in example

*Add one raw in given matrix as shown in example* A=[1 0;0 1]; X=[3 5]; Answer must be:[1 0; 0 1;3 5]

3 years ago

Solved

Pointwise multiplication of vectors.

Pointwise multiplication of vectors x and y. Example x= [1 3 5 7 9 11 13 15 17 19] y=[ 1 4...

3 years ago

Solved

Extract a specific part of matrix!

In the given matrix, extract element that have odd rows and column number. For example A=[1 4 2 3 5] B=extractodd(A);...

3 years ago

Solved

Reverse Concatenation

Suggest methods to form a Matrix after deleting one of the input's elements. Input should be element's position and output shou...

3 years ago

Solved

Find Sign(Zero Crossing) Changes in Array

Example; A = [1 2 3 -3 -4 -1 -24 2 4 -1 -2 3 1]; ans; [1 2 0 -3 -4 -1 0 2 0 -1 ...

3 years ago

Solved

MPS to MPH

Given the speed in miles per second, find the speed in miles per hour.

3 years ago

Solved

Shift elements of vector left

Shift elements of vector to the left. For ex. : Input_vec = [1 2 3 4 5] Output_vec = [2 3 4 5 1]

3 years ago

Solved

Find the minimal value in N*N Matrix

Suppose that we have N by N matrix, we try to find the minimal value in that matrix. examples: Input A=[1 2 3 5 6;52 58 56 45...

3 years ago