A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

Réponse apportée
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;...

presque 10 ans il y a | 2

Réponse apportée
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)))

presque 10 ans il y a | 1

Réponse apportée
string to number conversion with mixed values
str1 = 'index_N=10' str2 = 'index_M=5' sub1 = str1(7:end) sub2 = str(7:end)

presque 10 ans il y a | 0

Réponse apportée
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...

presque 10 ans il y a | 0

A résolu


Adding each element
Add the each element of the matrix.

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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.

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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.

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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.

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

A résolu


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

presque 10 ans il y a

Charger plus