Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle.
<<https://imgur...
3ヶ月 前
解決済み
Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...
3ヶ月 前
解決済み
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...
Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers.
Examples:
[index1 index2] = nearestNumbers([2 5 3...
3ヶ月 前
解決済み
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
3ヶ月 前
解決済み
Guess Cipher
Guess the formula to transform strings as follows:
'Hello World!' --> 'Ifmmp Xpsme!'
'Can I help you?' --> 'Dbo J ifm...
3ヶ月 前
解決済み
Counting in Finnish
Sort a vector of single digit whole numbers alphabetically by their name, in Finnish.
See the Wikipedia page for <http://en.wik...
3ヶ月 前
解決済み
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...
3ヶ月 前
解決済み
Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...
3ヶ月 前
解決済み
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to find the logical indices o...
3ヶ月 前
解決済み
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,2,3];
Returns 1.
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
3ヶ月 前
解決済み
Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes.
---
If you want to get a random permutation of integer...
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
3ヶ月 前
解決済み
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
3ヶ月 前
解決済み
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 = ...