解決済み


Polygonal numbers
The task of <http://www.mathworks.co.uk/matlabcentral/cody/problems/5 Problem 5> is to calculate triangular numbers. By playing ...

10年以上 前

解決済み


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

10年以上 前

解決済み


Generalized Fibonacci
The Fibonacci sequence is defined as: Fib(1) = 0 Fib(2) = 1 Fib(N) = Fib(N-1) + Fib(N-2) The Fibonacci sequence ca...

10年以上 前

解決済み


Create the following sequence : 0 1 1 4 9 25 64 169 ...
The sequence 0, 1, 1, 4, 9, 25, 64, 169, ... represents the square of the sequence of Fibonacci numbers. Let n repres...

10年以上 前

解決済み


Given a number find two variables
If the input is *x*, find *a* and *b* from the following equation: *x = a*2^b*. Hint: *b* is an integer while *x* and *a* ar...

10年以上 前

解決済み


Compute the dilation of a binary image
A basic operation in image analysis is the dilation. Given an image where each pixel is either on or off (black/white, true/fals...

10年以上 前

解決済み


Rank of magic square (for beginners)
Compute the rank r of a magic square of order n WITHOUT rank and magic functions.

10年以上 前

解決済み


Measure a Special Distance
Given an n-by-2 matrix with positive and negative numbers, return an n-by-n matrix in the manner of the function template.

10年以上 前

解決済み


Find the position of last minimum value in an integer array with numbers
If x = [2 6 4 9 -10 3 1 5 -10] then the output should be 9, because last minimum value (-10) lies at the 9th position.

10年以上 前

解決済み


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

10年以上 前

解決済み


If you prick us, do we not bleed?
While doing some quick sewing to fix up your child's Halloween costume, you accidentally jab your finger with the needle. Refle...

10年以上 前

解決済み


Moore-Penrose pseudoinverse of matrix
Find the command for Moore-Penrose pseudoinverse of matrix and solve

10年以上 前

解決済み


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

10年以上 前

解決済み


Distance a ball travels after throwing vertically
Calculate the total distance *'d'* (in meters) a ball would travel after *'s'* seconds and starting velocity of *'v'* (in m/s). ...

10年以上 前

解決済み


Implement a bubble sort technique and output the number of swaps required
A bubble sort technique compares adjacent items and swaps them if they are in the wrong order. This is done recursively until al...

10年以上 前

解決済み


A Poker Hand
Texas Hold ‘Em is a classical card game. In this problem, we are concerned with determining the probability of attaining a certa...

10年以上 前

解決済み


Sales Prediction
Miss X is a shopaholic person and every weekend she goes to a mall. There are total of 10 shops. Miss X starts from shop #1 and ...

10年以上 前

解決済み


Numeric array to cell array of strings (easy)
Given a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which e...

10年以上 前

解決済み


Path of least resistance
Find the length of the shortest path through the matrix from the top left to bottom right corner. You may move right, down, or d...

10年以上 前

解決済み


Polynomial Evaluation
Create a routine that takes a list of coefficients of a polynomial in order of increasing powers of x; together with a value of ...

10年以上 前

解決済み


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

10年以上 前

解決済み


Model a falling body
An object is falling freely from a height of 22 meters under the force of gravity. <<http://blogs.mathworks.com/images/seth/c...

10年以上 前

解決済み


unique with nan
input x = [2 NaN 3 5 NaN; 1 NaN 4 9 NaN; 8 -2 7 6 -2; 7 4 8 5 4]; output y_correct = [2 ...

10年以上 前

解決済み


longest sequence of nans
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

10年以上 前

解決済み


Converting Decimal to Binary
Given a decimal number that may include a fractional component, convert it into binary representation. The numbers you are given...

10年以上 前

解決済み


Determine the full width at half max
Determine the full width at half max of a curve. The full width at half maximum (FWHM) is a parameter which is used for desc...

10年以上 前

解決済み


List of built-in demo images
Return a cell array containing the filenames for built-in images (e.g. cameraman.tif, coins.png). An optional input specifies wh...

10年以上 前

解決済み


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

10年以上 前

解決済み


execute the declaration in strings and return value
execute the commands in strings and return value input='a=23' output=23

10年以上 前

解決済み


Create cell array of strings
Convert the input to a cell array, but only if necessary. If the input is a string, return a 1-by-1 cell array containing the...

10年以上 前

さらに読み込む