解決済み


interesting center of magic matrix
output the centre of magic matrix of n input=7; output=25

11年以上 前

解決済み


Square Diagonal
If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

11年以上 前

解決済み


Upper triangular matrix
Create a function to retrieve the upper triangular matrix of a matrix (without using tril). The matrix will always be square. ...

11年以上 前

解決済み


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

11年以上 前

解決済み


Duplicate a character
Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

11年以上 前

解決済み


Building matrices
If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

11年以上 前

解決済み


Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

11年以上 前

解決済み


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

11年以上 前

解決済み


Complex number
For complex number c=a+bi, write code that will add a and b together.

11年以上 前

解決済み


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

11年以上 前

解決済み


Max index of 3D array
Given a three dimensional array M(m,n,p) write a code that finds the three coordinates x,y,z of the Maximum value. Example ...

11年以上 前

解決済み


Rounding
Round 10.67 and make 'y' equal to that number.

11年以上 前

解決済み


Create a random logical vector of N elements of which M are true.
Your task for tomorrow is to create a random binary (logical) vector of N elements of which M are true. For example: ran...

11年以上 前

解決済み


Integer or Float?
Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise ret...

11年以上 前

解決済み


Power supply: 230V to 115V
The problem is simple: we have a wall outlet which supplies 230V and an apparatus that requires 115V. Software is always chea...

11年以上 前

解決済み


Weave two vectors into one
Weave the two given vectors into one as shown below. Example: If a = [1 1 1] b = [0 0 0] then y = [1 0 1 0 ...

11年以上 前

解決済み


Hard limit function
Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

11年以上 前

解決済み


Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

11年以上 前

解決済み


calculate linear convolution two vectors
for e.g in: a = [1 2 3] b = [4 5 6] out: y = [4 13 28 27 18]

11年以上 前

解決済み


Calculate distance travelled when given radius and rotations
When given radius of wheel and number of rotations calculate total distance travelled consider pi=3.14

11年以上 前

解決済み


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

11年以上 前

解決済み


commutative?
Given the handle to a binary function that takes two ordinary numbers, test if the function is commutative.

11年以上 前

解決済み


Sum the entries of each column of a matrix which satisfy a logical condition.
Given a numeric matrix A and a logical array L of the same size as A, return a row vector S containing the columnwise sums of th...

11年以上 前

解決済み


Nilpotent matrix
Check if matrix A is <http://mathworks.com/ nilpotent>.

11年以上 前

解決済み


Binary
Given a positive, integer n, create a function that returns the respective binary number in the form of a vector. Example: ...

11年以上 前

解決済み


Generate a string like abbcccddddeeeee
This is the string version of Problem 1035. <http://www.mathworks.com/matlabcentral/cody/problems/1035-generate-a-vector-like-1-...

11年以上 前

解決済み


Colon operator of two vectors
You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

11年以上 前

解決済み


Who has power to do everything in this world?
There is only one person who is older than this universe. He is Indian version of Chuck Norris.

11年以上 前

解決済み


Given area find sides
In a right angle triangle given area 'A' one arm=x, another arm=2x then find the value of x. For example, area A=400 then ...

11年以上 前

解決済み


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

11年以上 前

さらに読み込む