Solved


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

nästan 6 år ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

nästan 6 år ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

nästan 6 år ago

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

nästan 6 år ago

Solved


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

nästan 6 år ago

Solved


Compute the step response of a DC motor
Compute the step response of a DC motor shown below <<http://blogs.mathworks.com/images/seth/cody/dc-motor.png>> The param...

ungefär 6 år ago

Solved


Make a low pass filter
Make a first order low pass filter that will filter out the high frequency oscillations for the given input signal. The cut-off ...

ungefär 6 år ago

Solved


Produce a Fibonacci sequence
Construct a diagram that generates the Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34.....up to 377 The Fibonacci sequ...

ungefär 6 år ago

Solved


Model a simple pendulum
Model a simple pendulum of length 200cm with bob of mass 100g and plot the position in degrees. The pendulum starts at 30 degree...

ungefär 6 år ago

Solved


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

ungefär 6 år ago

Solved


Add damping to a mass spring system
Model an ideal mass-spring-damper system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/im...

ungefär 6 år ago

Solved


Model a mass spring system
Model an ideal mass-spring system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/images/se...

ungefär 6 år ago

Solved


Counting pulses in a signal
Count the number of pulses that are the result of summing each pulse generator block. Pulse Generator blocks produce a recurr...

ungefär 6 år ago

Solved


Make a full wave rectifier
Produce a full wave rectifier waveform for the given sine wave source. For a sine wave input, the output of the full wave rec...

ungefär 6 år ago

Solved


Make a half wave rectifier
Produce a signal that outputs the given sine wave source when it is greater than zero and outputs zero when it is less than zero...

ungefär 6 år ago

Solved


Produce a cosine wave
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>

ungefär 6 år ago

Solved


Produce a sine wave
Produce a sine wave with amplitude 3: <<http://blogs.mathworks.com/images/seth/cody/sine-eqn.png>>

ungefär 6 år ago

Solved


Add offset to a signal
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-offset-eqn.png>> You should see a downward...

ungefär 6 år ago

Solved


Add a block to a model
Produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/add-block-eqn.png>> In this case, the slope of...

ungefär 6 år ago

Solved


Connect blocks in a model
Connect the blocks in the model to produce the following signal: <<http://blogs.mathworks.com/images/seth/cody/connect-blocks...

ungefär 6 år ago

Solved


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

ungefär 6 år ago

Solved


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

ungefär 6 år ago

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

ungefär 6 år ago

Solved


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

ungefär 6 år ago

Solved


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

ungefär 6 år ago

Solved


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

ungefär 6 år ago

Solved


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

ungefär 6 år ago

Solved


Find the alphabetic word product
If the input string s is a word like 'hello', then the output word product p is a number based on the correspondence a=1, b=2, ....

ungefär 6 år ago

Solved


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

ungefär 6 år ago

Solved


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

ungefär 6 år ago

Load more