Solved


Best Problem Elections
When I am writing those words, there are 2002 problems on Cody. Many of them are simply wonderful. Do you remember which of them...

9 years ago

Solved


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

9 years ago

Solved


Calculate inverse matrix in square matrix
A=eye(3) Calculate inverse matrix of given input. B=function(A) ans = 1 0 0 0 1 0 ...

9 years ago

Solved


Cell Source Index
Suppose that C is a cell array whose elements consist of row vectors of elements of the same type. For example, C could be a ce...

9 years ago

Solved


Log of a number
Write a script that will give the log of x as output.

9 years ago

Answered
If I select an element in a matrix, say MAT(2,2), how to find how many elements of the same value of MAT(2,2) in the matrix are "connected" to it.
You need bwconncomp <https://it.mathworks.com/help/images/ref/bwconncomp.html> For example: Mat=[1 2 3 4 2;2 2 2 2 0;...

9 years ago | 2

Answered
how to change or compliment a particular bit in the binary string?
Here it is a=50; b=dec2bin(a) pos = 4; b(pos) = char(97-double(b(pos)))

9 years ago | 1

Answered
string to number conversion with mixed values
str1 = 'index_N=10' str2 = 'index_M=5' sub1 = str1(7:end) sub2 = str(7:end)

9 years ago | 0

Answered
How do i adjust the spacing between the slices of my stacked images?
First, most probably you don't want to stack them in the 4-th dimension as you wrote rgb4D = cat(4, IA, IB, IC, ID); Bec...

9 years ago | 0

Solved


Adding each element
Add the each element of the matrix.

9 years ago

Solved


What is Title of Cody Challenge 42?
Given a Cody Challenge number return its Title. *Input:* Cody Challenge Number *Output:* Title of the Cody Challenge ...

9 years ago

Solved


Deriving a function using the difference quotient
Write a function that evaluates the derivative of a function in a given point using the well-know formula of the difference quot...

9 years ago

Solved


Create an m x n array consisting only of an input value.
Create an array with m rows and n columns wherein all entries are assigned the input value x.

9 years ago

Solved


Find files with extension ext in the current directory
List all files with extension 'ext' in the current directory. Return a char matrix with the name of files in rows. Return 0 if...

9 years ago

Solved


For a given linear index as input for n sized square matrix, find corresponding row and column.
If input is 1, the row and column will be 1 and 1 respectively.

9 years ago

Solved


Airline Ticket Mod7 Checksum
There are 13 digits in an airline ticket number. If an airline ticket number is valid, the 13th digit should be the remainder of...

9 years ago

Solved


Corresponding letter to ASCII code.
Given the letter, the output will show the corresponding ASCII code.

9 years ago

Solved


matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix [ 1 2 3 ; 4 5 6 ; 7 8 9 ] the resulting 1-...

9 years ago

Solved


"Power matrix" of two vectors
Given two row vectors x,y of lengths m and n (respectively), create an m x n matrix whose i,j entry is x(i)^y(j).

9 years ago

Solved


Permutations of input vector
Find and output all permutations of given vector

9 years ago

Solved


Which way to go?
Given an m*n grid, How many ways are there to go from upper left corner to the lower right one? You can only move right...

9 years ago

Solved


Sum my indices
Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

9 years ago

Solved


Convert number from given base to other base
Convert number from given base to other base. Example 400 in base 5, find equivalent number in base 8, it is 144.

9 years ago

Solved


Combination logic
Create an algorithm in MATLAB that calculate the combination for the given positive integers n and k as inputs. When k > n, the ...

9 years ago

Solved


Increase monotonically
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

9 years ago

Solved


Step up
For given input array, output a array with all elements step up by two

9 years ago

Solved


most frequent character
Obtain most frequent character Let s='balaram'; output='a';

9 years ago

Solved


Soccer - TOTO
How many different outcomes are there in a soccer-TOTO with n games? For each game there are three results: win - loss - equa...

9 years ago

Solved


Cofactor
Given a matrix, find the cofactor of the element in 'i'th row and 'j'th column.

9 years ago

Solved


Repeat The Components of Matrix
Repeat The components of a matrix so that the size of the output matrix is double to input matrix and components are repeated ne...

9 years ago

Load more