Solved


Generate a vector which contains a pyramid pattern (★★★★)
Generate a vector that contains terms that follows a pyramid pattern up to the nth row: 1 2 2 3 3 3 4 4 4 4 ...

5 years ago

Solved


Extract leading non-zero digit (★★★★★)
(Copy of Problem 47) Benford's Law states that the distribution of leading digits is not random. This is probably because man...

5 years ago

Solved


Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

5 years ago

Solved


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

5 years ago

Solved


Stacking vectors into a matrix
Given a 4x1 vector a, and a 2x2 matrix b, create a matrix M in which the first 2 rows are each identical to a and the last two r...

5 years ago

Solved


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

5 years ago

Solved


Logarithmically spaced vector creation using logspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Use the logspace operator.

5 years ago

Solved


Vector creation using colon operator
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use the colon (:) operator.

5 years ago

Answered
How do I add values of a function to a matrix?
nada=zeros(64); for a=1:64 for b=1:64 nada(a,b)=delta(a,b); end end

5 years ago | 0

Solved


Make a checkerboard matrix (★★★★★)
(copy of Prob. 4) Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1...

5 years ago

Solved


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

5 years ago

Solved


Determine the average number of rounds for the following game.
Each round a uniformly distributed random number is picked between 0 and 1. The game ends when the sum of the random numbers is ...

5 years ago

Solved


Compute a sum of Ramanujan
Srinivasa Ramanujan defined the following function: Write a function to compute for various values of . See also Cody Proble...

5 years ago

Solved


Right shift an array n times with constant space.
Right shift an array n times with constant space, that is, no extra array can be used. Right shift operation: Last element com...

5 years ago

Solved


Function - Cylinder Surface Area
The goal

5 years ago

Solved


SatCom #6: Inclination of a Sun-Synchronous Orbit
*Satellite and Space Engineering - Problem #5* _This is part of a series of problems looking at topics in satellite and space...

5 years ago

Solved


Calculate Engine Power
Calculate Engine Power (P) in kW given the values of Torque(M) in Nm and Engine Speed(n) in rpm

5 years ago

Solved


Compute the missing quantity among P, V, T for an ideal gas
Consider 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law appli...

5 years ago

Solved


Electrical Diode Current Calculation
In engineering, there is not always a single equation that describes a phenomenon accurately enough to be applied in all instanc...

5 years ago

Answered
conditional representation of logical numbers
a='111110011111000000011000011111'; a=strrep(a,'1001','111'); a=strrep(a,'101','111'); a=strrep(a,'010','000'); a=strrep(a,'...

5 years ago | 0

| accepted

Solved


Most Frequent Word - 01
Given a document file or a character array, find out the most frequent word in that document. In the case of multiple words -...

5 years ago

Solved


List the good primes

5 years ago

Solved


Find the smallest integer m such that n divides m!
Write a function that takes an integer and finds the smallest integer whose factorial is divisible by . For example, if , then...

5 years ago

Solved


Goldbach's marginal conjecture - Write integer as sum of three primes
Goldbach's strong conjecture states that every even integer greater than 2 can be expressed as the sum of two primes. For exampl...

5 years ago

Solved


Twins in a Window
<http://en.wikipedia.org/wiki/Twin_primes Twin primes> are prime numbers that differ by 2, such as [11,13] or [41,43]. Write a f...

5 years ago

Answered
How to solve an inequality
f=@(x)15*x-15+0.41*(sqrt(1/60516+1/123*(15*x-2.9))-1/246)^2*3000-2.9; g=@(x)1/60516+1/123*(15*x-2.9); x=[fzero(g,.2),fzero(f,....

5 years ago | 0

| accepted

Answered
Sort columns to get the lowest possible difference in every row
A for-loop can go through 200,000 cycles quite fast. Not sure there is an easiler way. a=A(:,1); b=A(:,2); tol=3; for k=1:si...

5 years ago | 0

Solved


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

5 years ago

Solved


arithmetic progression
I've written a program to generate the first few terms of <https://en.wikipedia.org/wiki/Arithmetic_progression arithmetic progr...

5 years ago

Solved


Largest Geometric Series
Extension of Ned Gulley's wonderful <http://www.mathworks.com/matlabcentral/cody/problems/317 Problem 317>. In a geometric se...

5 years ago

Load more