intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identic...
約1ヶ月 前
解決済み
Return unique values without sorting
If the input vector A is [42 1 1],
the output value B must be the unique values [42 1]
The values of B are in the same order a...
約1ヶ月 前
解決済み
First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero i...
約1ヶ月 前
解決済み
Getting the indices from a matrix
Inspired by Problem 645.
Getting the indices from a matrix.
Given a matrix A (or a vector), return the indices (always in row...
約1ヶ月 前
解決済み
Generate this matrix
Generate the following matrix.
n = 2;
out = [-4 -3 -2 -1 0
-3 -2 -1 0 1
-...
約1ヶ月 前
解決済み
Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...
約1ヶ月 前
解決済み
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
約1ヶ月 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
約1ヶ月 前
解決済み
Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...
約1ヶ月 前
解決済み
Create a figure and plot data
Given two data vectors (x,y), open a new figure and plot the data. Return the figure handle.
約1ヶ月 前
解決済み
Plotting Practice
Plot cos(x) vs x as shown in the figure below. Include the appropriate title, x-label, and y-label. Note, it is case sensitive. ...
Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas:
1 kilogram = 2.2 pounds
1 inch = 2...
約1ヶ月 前
解決済み
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 ...
約1ヶ月 前
解決済み
Calculate Amount of Cake Frosting
Given two input variables r and h, which stand for the radius and height of a cake, calculate the surface area of the cake you n...
約1ヶ月 前
解決済み
Find the Oldest Person in a Room
Given two input vectors:
* |name| - user last names
* |age| - corresponding age of the person
Return the name of the ol...
約1ヶ月 前
解決済み
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...
約1ヶ月 前
解決済み
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:...