Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...
7ヶ月 前
解決済み
Unit conversion
Convert x degree Celsius to y degree Fahrenheit.
7ヶ月 前
解決済み
Find out magnitude of vector
Find out magnitude of vector.
Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2)
Please don't use sum function.
If you l...
Matlab Basics - Logical Tests I
Write a script to test whether a year number is for a leap year or not.
eg. x = 1884
output = 1
eg. x = 3
output = 0
7ヶ月 前
解決済み
Remove the positive integers.
Given array x (of integers), remove all the positive numbers and display ouput as y.
Example x=[1 -2 3 -4] , output is y=[-2 -...
Derivative of polynomial
Compute the derivative of a given polynomial. The input is an <http://www.mathworks.com/help/matlab/math/representing-polynomial...
7ヶ月 前
解決済み
metre to feet converter
The idea is to make a converter, which exchange meters to feets.
We use a factor of 1m = 3.281*1f.
so 3m are equals to 9.843 m...
Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n.
For example:
v=[1 2 3 4 5 6]
n=3
vNew =...
7ヶ月 前
解決済み
Back to basics 19 - character types
Covering some basic topics I haven't seen elsewhere on Cody.
Return the number of punctuation characters in the input variabl...
Back to basics 17 - white space
Covering some basic topics I haven't seen elsewhere on Cody.
Remove the trailing white spaces from the input variable
7ヶ月 前
解決済み
Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n.
Examples
If input t1=1, r=1, n=7 the...
7ヶ月 前
解決済み
Sum of the Multiplication of Vectors
Given the vectors x and y as input, multiply the vectors and return the summation of its elements.
Example:
x = [1 2 ...
matrix of natural number
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 resides seially as shown in the examples below.
...
7ヶ月 前
解決済み
Box!
Given a box, find the volume of the cube. With each side = a.