Gelöst


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

30 Tage vor

Gelöst


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


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

30 Tage vor

Gelöst


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

30 Tage vor

Gelöst


Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

30 Tage vor

Gelöst


Index of a Rational number
The set of real numbers are infinite. They are so many that real numbers can't even be enumerated. However, unlike real numbers ...

30 Tage vor

Gelöst


Tridiagonal
Return an n-by-n matrix that has a, b, c as the subdiagonal, main diagonal, and superdiagonal entries in the matrix. Example ...

30 Tage vor

Gelöst


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

30 Tage vor

Gelöst


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

30 Tage vor

Gelöst


Another colon problem
This is simple problem based on problems 555, 801, 1118, etc. Create an index vector from two input vectors. Example: ...

30 Tage vor

Gelöst


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

etwa ein Monat vor

Gelöst


expand intervals vol.3
This is the next problem after <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528> and <http://www.mathworks.co.u...

etwa ein Monat vor

Gelöst


Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

etwa ein Monat vor

Gelöst


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

etwa ein Monat vor

Gelöst


Sieve of Eratosthenes - 02
"Sift the Two's and Sift the Three's, The Sieve of Eratosthenes. When the multiples sublime, The numbers that remain a...

etwa ein Monat vor

Gelöst


Converts numbers into characters
Converts numbers into characters

etwa ein Monat vor

Gelöst


Create a figure and plot data
Given two data vectors (x,y), open a new figure and plot the data. Return the figure handle.

etwa ein Monat vor

Gelöst


Sum of series III
What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

etwa ein Monat vor

Gelöst


Sum of series II
What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

etwa ein Monat vor

Gelöst


Make roundn function
Make roundn function using round. x=0.55555 y=function(x,1) y=1 y=function(x,2) y=0.6 y=function(x,3) ...

etwa ein Monat vor

Gelöst


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

etwa ein Monat vor

Gelöst


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

etwa ein Monat vor

Gelöst


Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places: e.g. x = 2.3456 --> y = 2.346

etwa ein Monat vor

Mehr laden