Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?;
x = [1 : 0.5 : 6];
y ...
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x.
For instance if x=2 then y must be 1+2+3+4=10.
3 years 前
已解决
Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.
Exam...
3 years 前
已解决
Unit Matrix
Given n, you should return an n-by-n unit matrix.
Example:
If input is n=2 then
A = [ 1 0
0 1 ]
If input ...
3 years 前
已解决
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 C...
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]
...
3 years 前
已解决
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];
...
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:...
4 years 前
已解决
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...