Feeds
已解决
create a square matrix
create a [n*n] matrix. example: mat(4)= [ 1 4 9 16 4 4 9 16 9 9 ...
4 days 前
已解决
Is the number of 1s in a binary integer odd or even?
Your function should turn the input integers into binary form and count the number of 1s in the binary. If the number is odd, re...
4 days 前
已解决
Make an identity matrix whose diagonal elements are 1:n
For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5: ...
4 days 前
已解决
Sum All Positive Elements
Output a scalar that is equal to the sum of all positive elements in a given vector/matrix. For Example: The sum of all positi...
4 days 前
已解决
Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...
4 days 前
已解决
Sum of elements in a vector (★)
(copy of Prob. 3) Find the sum of all the numbers of the input vector x. Input x = [1 2 3 5] Output y is 11 <> ...
4 days 前
已解决
Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....
11 days 前
已解决
Return the Square of a Number
Write a function that takes a single numeric input x and returns its square. That is, given x, your function should output x^2....
11 days 前
已解决
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:...
11 days 前
