Community Profile

photo

Nicolas BERNARD


Last seen: 10ヶ月 前 2016 年からアクティブ

統計

  • Introduction to MATLAB Master
  • Promoter
  • Solver

バッジを表示

Content Feed

表示方法

解決済み


Convert radians to degrees
Given input in radians, output to degrees

約3年 前

解決済み


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

約3年 前

解決済み


Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

約3年 前

解決済み


Convert a numerical matrix into a cell array of strings
Given a numerical matrix, output a *cell array of string*. For example: if input = 1:3 output is {'1','2','3'} whic...

約3年 前

解決済み


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

約3年 前

解決済み


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

約3年 前

解決済み


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

約3年 前

解決済み


Return area of square
Side of square=input=a Area=output=b

約3年 前

解決済み


Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

約4年 前

解決済み


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

約4年 前

解決済み


Calculate the Hamming distance between two strings
Inspired by a similar Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-dist...

6年以上 前

解決済み


Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

6年以上 前

解決済み


Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...

6年以上 前

解決済み


Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...

6年以上 前

解決済み


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

6年以上 前

解決済み


Create a Standard Size Vector
Given an input x, create a row vector y from 1 to x with 5 elements.

6年以上 前

解決済み


means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

6年以上 前

解決済み


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

6年以上 前

解決済み


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

6年以上 前

解決済み


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

6年以上 前

解決済み


Sum of series V
What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

6年以上 前

解決済み


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

6年以上 前

解決済み


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

6年以上 前

解決済み


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

6年以上 前

解決済み


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

6年以上 前

解決済み


Create a matrix X, where each column is a shifted copy of the vector v
Example : in->v = (1:5)'; 1 2 3 4 5 out-> [1 5 4 3 2;2 1 5 4 3;3 2 1 5 4;4 3 2 1 5;5 4 3 ...

6年以上 前

解決済み


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

6年以上 前

解決済み


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

6年以上 前

解決済み


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

6年以上 前

解決済み


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

6年以上 前

さらに読み込む