Average Grade
Given a 1x5 vector presents the grades of a student on five tests. Calculate the average grade of that student.
7年弱 前
解決済み
Put Two 1D matrices into one 1D matrix
Example:
If
input a = [1 2 3 4 5];
input b = [10 9 8 7 6];
then output will be,
y_correct = [1 10 2 9 3 8 4 7 5...
7年弱 前
解決済み
does it touch ?
given a sentence, tell how much it touches.
input : string
output : how much it touches
touching : a bilabial phoneme d...
7年弱 前
解決済み
Reverse a string
Reverse the given string.
Example
input = 'reverse'
output = 'esrever'
7年弱 前
解決済み
How many Integers?
Count the integers in a given vector |v|.
You *must* use a loop to count each element separately.
Examples:
Input: v...
7年弱 前
解決済み
Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...
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...
7年弱 前
解決済み
Matrix with different incremental runs
Given a vector of positive integers a (>=0); How does one create the matrix where the ith column contains the vector 1:a(i) poss...
7年弱 前
解決済み
Remove the air bubbles from a vector
_*A reduced version of Problem 112*_
Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...
Matlab Basics II - Log and natural log
Write a function that calculates the difference between the log and natural log of a vector, to two decimal places
example:
...
Multiples of a Number in a Given Range
Given an integer factor _f_ and a range defined by _xlow_ and _xhigh_ inclusive, return a vector of the multiples of _f_ that fa...
7年弱 前
解決済み
UICBioE240 problem 1.5
Find the size of the matrix, then multiply both values by 10 and make it into a column vector.
So if A = [ 1 2 3;
...
Signed Magnitude
For a given input vector, return the value that is furthest from zero.
For example, if
x = [1 2 -12]
return -12.
7年弱 前
解決済み
Relative ratio of "1" in binary number
Input(n) is positive integer number
Output(r) is (number of "1" in binary input) / (number of bits).
Example:
* n=0; r=...