The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
4년 초과 전
문제를 풀었습니다
2 b | ~ 2 b
Given a string input, output true if there are 2 b's in it, false if otherwise
Examples:
'Macbeth' -> false
'Publius Cor...
4년 초과 전
문제를 풀었습니다
Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'.
Examples
x = [ 1...
Mode
Find the mode of the vector
Assumption: no vector is bimodal
Example 1: input=[1 2 3 4 4]; output=4
Example 2: input=[7...
4년 초과 전
문제를 풀었습니다
Total resistance of resistors in series
What is the total resistance of a number of resistors in series?
A vector R contains the resistances (in Ohm) of n resistors, w...
4년 초과 전
문제를 풀었습니다
Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...
4년 초과 전
문제를 풀었습니다
03 - Matrix Variables 4
Make the following variable:
<<http://samle.dk/STTBDP/Assignment1_3d.png>>
A 3x4 NaN (Not a Number) matrix
(Hint: use ...
4년 초과 전
문제를 풀었습니다
Remove DC
Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.
Examp...
4년 초과 전
문제를 풀었습니다
01 - Scalar variables
Create the following variables:
<<http://samle.dk/STTBDP/Assignment1_1.png>>