Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example:
[q,r] = swap(5,10)
returns q = ...
8 years 前
已解决
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
8 years 前
已解决
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 ...
8 years 前
已解决
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".
8 years 前
已解决
Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0.
a = 3;
b = [1,2,4];
Returns 0.
a = 3;
b = [1,...
8 years 前
已解决
Add offset to a signal
Produce the following signal:
<<http://blogs.mathworks.com/images/seth/cody/add-offset-eqn.png>>
You should see a downward...
8 years 前
已解决
Produce a sine wave
Produce a sine wave with amplitude 3:
<<http://blogs.mathworks.com/images/seth/cody/sine-eqn.png>>
8 years 前
已解决
Add a block to a model
Produce the following signal:
<<http://blogs.mathworks.com/images/seth/cody/add-block-eqn.png>>
In this case, the slope of...
8 years 前
已解决
Produce a cosine wave
Produce the following signal:
<<http://blogs.mathworks.com/images/seth/cody/cosine-eqn.png>>
8 years 前
已解决
Connect blocks in a model
Connect the blocks in the model to produce the following signal:
<<http://blogs.mathworks.com/images/seth/cody/connect-blocks...
8 years 前
已解决
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...
8 years 前
已解决
Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...
8 years 前
已解决
Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...
8 years 前
已解决
Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle.
<<http://upload....