Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes.
---
If you want to get a random permutation of integer...
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displa...
6 years 前
已解决
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
6 years 前
已解决
Find max
Find the maximum value of a given vector or matrix.
6 years 前
已解决
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B.
So if
A = [1 2 3;
4 5 6];
...
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...
Kinetic Energy
Given the mass m and velocity v of an object, determine its <http://en.wikipedia.org/wiki/Kinetic_energy kinetic energy>.
6 years 前
已解决
Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have
a = [1 2 2 2 1 ...
6 years 前
已解决
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,....
6 years 前
已解决
Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...
6 years 前
已解决
Rescale Scores
Each column (except last) of matrix |X| contains students' scores in a course assignment or a test. The last column has a weight...
6 years 前
已解决
Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match.
* If they match, create an output variable |z|...
6 years 前
已解决
Find the Best Hotels
Given three input variables:
* |hotels| - a list of hotel names
* |ratings| - their ratings in a city
* |cutoff| - the rat...
6 years 前
已解决
Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...
6 years 前
已解决
Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas:
* 1 kilogram = 2.2 pounds
* 1 ...