Create an anti-identity matrix
Create an anti-identity matrix of given dimension.
Examples
n = 2
A = [0 1; 1 0]
n = 3
A = [0 0 1; 0 1 0; 1 0 0...
約9年 前
解決済み
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.
約9年 前
解決済み
Sum of series I
What is the sum of the following sequence:
Σ(2k-1) for k=1...n
for different n?
約9年 前
解決済み
Find maximum value of a curve
Two vectors shall be already defined:
- Input vector x (e.g. x = 0:1:10)
- Result vector y (e.g. y = sin(x))
Create a n...
約9年 前
解決済み
Solve Linear equations
Solve Linear equations
Example: x+y=2 and x+2y=3, then x and y equal to 1.
Column norms of a matrix
Given a matrix M, return a vector y such that for each k
y(k)=norm(M(:,k))
(y(k) is the Euclidean norm of the k-th col...
約9年 前
解決済み
Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?;
x = [1 : 0.5 : 6];
y ...
約9年 前
解決済み
Area of a circle
Given the radius x, y would be the area of a circle.
Pi = 3.1416
約9年 前
解決済み
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 = ...
約9年 前
解決済み
square root
Find the square root (y) of an input (x).
約9年 前
解決済み
If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...
約9年 前
解決済み
Create sequnce 1 4 9 16 25.........
Create sequnce 1 4 9 16 25......... upto entered input value using matlab scripting commands. Let y be output and x be input
Generate a random matrix A of (1,-1)
Input n: is an positive integer which serves as the dimension of the matrix A;
Output: A=(Aij),where each entry Aij is either...
約9年 前
解決済み
Convert yards to feet
The goal of this script is to convert a value given in yards to feet.