Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix:
1 2 3 ...
4ヶ月 前
解決済み
Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...
4ヶ月 前
解決済み
Matrix with different incremental runs
Given a vector of positive integers
a = [ 3 2 4 ];
create the matrix where the *i* th column contains the vector *1:a(i)...
4ヶ月 前
解決済み
Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal.
Example:
>> M=magic(5);
>> flipDiagonal(M)
9 24 1 ...
4ヶ月 前
解決済み
Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, return a matrix with all elements above a...
4ヶ月 前
解決済み
surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones:
A = [1 2 ...
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];
...
4ヶ月 前
解決済み
Area of a circle
Find the value for area of the circle if diameter is given
4ヶ月 前
解決済み
Spot the First Occurrence of 5
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...
4ヶ月 前
解決済み
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
4ヶ月 前
解決済み
Television Screen Dimensions
Given a width to height ratio of a TV screen given as _w_ and _h_ as well as the diagonal length of the television _l_, return t...
Find the two most distant points
Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.