Print true if
all elements are larger than 5
a=[1 3 5 8 6];
b=[6 6 6 6 6];
function(a) should be false, and function(b) will be tru...
6年弱 前
解決済み
CARDS PROBLEM
Read my mind and tell me the card number that I have now in my hands.
6年弱 前
解決済み
Kinetic Energy
Given mass, m, and kinetic energy, KE, find the velocity of the object.
6年弱 前
解決済み
Diagonal & Anti-Diagonal Matrix: Easy
Create a matrix as shown below from "magic" square.
For example:
if input x=9;then use mgic(x) and create the matrix...
6年弱 前
解決済み
Sum the rows
Sum the rows of the given matrix.
Example
x = [ 1 2
3 4 ]
y = [ 3
7 ]
6年弱 前
解決済み
Was ist denn los?
Nur für deutschsprechende Leute!
Wie geht's?
...also gut, bis bald!
Replace values under a limit
For a vector x and number n, the goal is to find every element of x inferior to n and replace it by n.
Example
x= [ 1 2 3...
6年弱 前
解決済み
Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax:
a = zeros(1000,1000);
But when the function ends, I find that I don'...
6年弱 前
解決済み
Generate the Matrix!
Given n, generate the following matrix:
a = [ n n-1 n-2 ... 2 1;
n-1 n-1 n-2 ... 2 1;
n-2 n-2 n-2 ... 2 1;...
6年弱 前
解決済み
Calculate some equation
Using given inputs x and z, make two outputs that are
y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2
y2 = x^z - z^x + (x/z)^2 - (z/x...
Area of a Square
Given the length x of the side of a regular square, find the area of the square, A.
6年弱 前
解決済み
Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter).
Example
[1 2 3
4 5 6
7 8 9]
Output = ...
6年弱 前
解決済み
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 ...