Gelöst


Circular Primes (based on Project Euler, problem 35)
The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. The...

etwa 2 Jahre vor

Gelöst


Mersenne Primes vs. All Primes
A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

etwa 2 Jahre vor

Gelöst


The Goldbach Conjecture
The Goldbach conjecture asserts that every even integer greater than 2 can be expressed as the sum of two primes. Given the eve...

etwa 2 Jahre vor

Gelöst


Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime numb...

etwa 2 Jahre vor

Gelöst


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

etwa 2 Jahre vor

Gelöst


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

etwa 2 Jahre vor

Gelöst


Rescale Scores
Each column (except last) of matrix X contains students' scores in a course assignment or a test. The last column has a weighted...

etwa 2 Jahre vor

Gelöst


Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

etwa 2 Jahre vor

Gelöst


Find MPG of Lightest Cars
The file cars.mat contains a table named cars with variables Model, MPG, Horsepower, Weight, and Acceleration for several classi...

etwa 2 Jahre vor

Gelöst


Find the Best Hotels
Given three input variables: hotels - a list of hotel names ratings - their ratings in a city cutoff - the rating at which yo...

etwa 2 Jahre vor

Gelöst


Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

etwa 2 Jahre vor

Gelöst


Create block matrix of integers (j+k-1) - Part I
Given m, n, p, and q, create a matrix of m-by-n blocks (submatrices), each sized p-by-q. The elements of the (j,k)th block all h...

etwa 2 Jahre vor

Gelöst


Find similar sequences
Another problem inspired by a question on the <http://www.mathworks.com/matlabcentral/answers answers> forum. Given a matrix ...

etwa 2 Jahre vor

Gelöst


Generate Square Wave
Generate a square wave of desired length, number of complete cycles and duty cycle. Here, duty cycle is defined as the fraction ...

etwa 2 Jahre vor

Gelöst


Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

etwa 2 Jahre vor

Gelöst


Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas: 1 kilogram = 2.2 pounds 1 inch = 2...

etwa 2 Jahre vor

Gelöst


Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given number of...

etwa 2 Jahre vor

Gelöst


Is the Point in a Triangle?
Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

etwa 2 Jahre vor

Gelöst


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If p is the perimeter of a right angle triangle with integral length sides, { a, b, c }, there are exactly three solutions for p...

etwa 2 Jahre vor

Gelöst


Chess probability
The difference in the ratings between two players serves as a predictor of the outcome of a match (the <http://en.wikipedia.org/...

etwa 2 Jahre vor

Gelöst


Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.&#8519;^(-&lambda;t)*cos(2πft)| where |A|, |&lambda;|, and |f| ...

etwa 2 Jahre vor

Gelöst


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

etwa 2 Jahre vor

Gelöst


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

etwa 2 Jahre vor

Gelöst


ASCii Code
Using Matlab get the ASCii for '?'

etwa 2 Jahre vor

Gelöst


Mode
Find the mode of the vector Assumption: no vector is bimodal Example 1: input=[1 2 3 4 4]; output=4 Example 2: input=[7...

etwa 2 Jahre vor

Gelöst


Slope intercept application
Find y given slope (m), x, and y intercept (b).

etwa 2 Jahre vor

Gelöst


Dartboard Average II
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

etwa 2 Jahre vor

Gelöst


Dartboard Average I
A dartboard arranges the numbers 1 to 20 such that each value is typically flanked by quite different values - for example, 20 i...

etwa 2 Jahre vor

Gelöst


Possible Rugby Scores
Given a natural number s (> 4), representing a rugby team's score, return an n-by-3 matrix representing all n possible combinati...

etwa 2 Jahre vor

Gelöst


Split Even Number Into Two Primes
Given an even whole number n (> 2), return a 2-element vector of primes, p, such that p(1) + p(2) = n. Fun note: technically it...

etwa 2 Jahre vor

Mehr laden