Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
6年弱 前
解決済み
What percentage?
Calculate the output c as the percentage of a on b for given a and b.
6年弱 前
解決済み
Min of a Matrix
Return the minimum value in the given matrix.
6年弱 前
解決済み
Area of a Square
Inside a square is a circle with radius r.
What is the area of the square?
6年弱 前
解決済み
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 ...
Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
6年弱 前
解決済み
Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector, output true or false whether it is a colu...
6年弱 前
解決済み
kmph to mps
convert kilometer per hour to meter per second
6年弱 前
解決済み
Square the input
Given a scalar or vector x, return the square of each element.
Example
x = [7 2]
answer = [49 4]
6年弱 前
解決済み
Beginner's Problem - Squaring
Try out this test problem first.
Given the variable x as your input, square it by two and put the result in y.
Examples:
...
6年弱 前
解決済み
Convert yards to feet
The goal of this script is to convert a value given in yards to feet.
6年弱 前
解決済み
Sum of diagonal of a square matrix
If
x = [1 2 4; 3 4 5; 5 6 7]
then y should be the sum of the diagonals of the matrix
y = 1 + 4 + 7 = 12
6年弱 前
解決済み
Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.
Exam...
6年弱 前
解決済み
Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.