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 ...
9ヶ月 前
解決済み
Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples
n=2, A=[1 2 3] -> [1 1 2 2 3 3]
n=0...
9ヶ月 前
解決済み
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...
9ヶ月 前
解決済み
An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...
9ヶ月 前
解決済み
Solve a System of Linear Equations
Example:
If a system of linear equations in x₁ and x₂ is:
2x₁ + x₂ = 2
x₁ - 4 x₂ = 3
Then the coefficient matrix (A) is:
2 ...
9ヶ月 前
解決済み
Convert from Fahrenheit to Celsius
Given an input vector F containing temperature values in Fahrenheit, return an output vector C that contains the values in Celsi...
9ヶ月 前
解決済み
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
9ヶ月 前
解決済み
Maximum value in a matrix
Find the maximum value in the given matrix.
For example, if
A = [1 2 3; 4 7 8; 0 9 1];
then the answer is 9.
9ヶ月 前
解決済み
Sum of series I
What is the sum of the following sequence:
Σ(2k-1) for k=1...n
for different n?
9ヶ月 前
解決済み
Count number of words in string
Count number of words in string
Examples
'hi', answer is 1
'hi hi', answer is 2
'I enjoy cody', answer is 3