解決済み


What is the distance from point P(x,y) to the line Ax + By + C = 0?
Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

7年弱 前

解決済み


Generalised Hamming Number
Inspired by Project Euler n°204 and Problem 1308 by James A generalised Hamming number of type n, has no prime factor larger ...

7年弱 前

解決済み


Give me Hamming on five, hold the mayo
A Hamming Number is a positive number that has no prime factor greater than 5. Given a number X, determine how many Hamming num...

7年弱 前

解決済み


5 Prime Numbers
Your function will be given lower and upper integer bounds. Your task is to return a vector containing the first five prime numb...

7年弱 前

解決済み


ASCII Birthday Cake
Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

7年弱 前

解決済み


Half-Swap
Given a vector with an even number of elements, rearrange it so that the elements in its first half are switched with those i...

7年弱 前

解決済み


Cumulative product of a vector
Cumulative product of a vector example x=[1 2 5 10], then answer must be [ 1 2 10 100] *If you like this prob...

7年弱 前

解決済み


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

7年弱 前

解決済み


Largest Prime Number
Given a matrix X, find the largest prime number in X.

7年弱 前

解決済み


Element by element multiplication of two vectors
Given two input vectors, return the element-by-element product. Example A = [1 2 3] B = [7 3 1] The answer should be...

7年弱 前

解決済み


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

7年弱 前

解決済み


Hard limit function
Classify x data as if x>=0 then y=1 if x<0 then y=0 Example x = [ -2 -1 0 1 2] y = [ 0 0 1 1 1]

7年弱 前

解決済み


Output a vector which is table of 9
Output a vector which is table of 9

7年弱 前

解決済み


Delete 2nd and 5th column of Given 6*6 matrix
Delete the 2nd and 5th columns of the given 6*6 matrix. Example Suppose A = magic(6) 35 1 6 26 19 ...

7年弱 前

解決済み


Small Riddle
Mr. Smith has two children. If the older child is a boy, what are the odds that the other child is also a boy?

7年弱 前

解決済み


Find out value of sine given by degree.
Find out value of sine given by degree. If theta=30, it's value must be 0.5.

7年弱 前

解決済み


Is My Wife Wrong?
Answer the question. (see also <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right Problem 149: Is my ...

7年弱 前

解決済み


Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...

7年弱 前

解決済み


y equals x divided by 2
function y = x/2

7年弱 前

解決済み


Change the sign
Given a matrix x, return one with each diagonal element replaced by its absolute value and the largest element in absolute value...

7年弱 前

解決済み


Celsius to Fahrenheit converter
Convert Celsius to Fahrenheit degrees.

7年弱 前

解決済み


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

7年弱 前

解決済み


Generate a string like abbcccddddeeeee
This is the string version of Problem 1035. <http://www.mathworks.com/matlabcentral/cody/problems/1035-generate-a-vector-like-1-...

7年弱 前

解決済み


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

7年弱 前

解決済み


Matlab Basics - y as a function of x
Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2

7年弱 前

解決済み


Which quadrant?
Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

7年弱 前

解決済み


sum of non-primes
The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38 Find the sum of all the positive non-prime integers that do no...

7年弱 前

解決済み


Recursion at variable input
input of any length a =2 b =2 c =3 output = (a^b)^c = 64

7年弱 前

解決済み


Determine the mean of matrix
Determine the mean of matrix without using mean function Hint: use simple algorithm

7年弱 前

解決済み


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

7年弱 前

さらに読み込む