Max of a Vector
Write a function to return the max of a vector
約7年 前
解決済み
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...
約7年 前
解決済み
Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...
約7年 前
解決済み
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not ...
約7年 前
解決済み
MATLAB Basic: rounding IV
Do rounding towards plus infinity.
Example: -8.8, answer -8
+8.1 answer 9
+8.50 answer 9
約7年 前
解決済み
Y=X
Given an input variable x, output a variable y that is equal in value to x.
Example:
Input x = 1
Output y is 1
Inp...
約7年 前
解決済み
Transpose
Write a MATLAB script in order to convert a random length row vector (v) into a column vector.
約7年 前
解決済み
Reverse a matrix
Its simple. You have to reverse a given matrix.
Evaluating a polynomial
Given the following polynomial and the value for x, determine y.
y = 3x^5 – x^3 + 8x – 3
Example
x = 1
y = 3 - 1 +...
約7年 前
解決済み
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 ...
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...
Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.
約7年 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
約7年 前
解決済み
Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector of numbers, output a square array with the...
約7年 前
解決済み
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
約7年 前
解決済み
Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...