Summation of array
Given an array, Find the sum of all of the elements in it
Examples:
Input x = [1 2 3 5; 4 5 6 7];
Output y is 33
2年弱 前
解決済み
means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...
2年弱 前
解決済み
Basic Mathematics 4
Team #1 is in first place but only one point higher than Team #2. The sum of their two scores is N. What are each team’s scores...
2年弱 前
解決済み
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<https://i.imgur.com/jlZDHhq.png>>
Image courtesy of <http://up...
Current through resistor
Three resistors (R2, R3, R4) are connected in parallel as shown in the figure. If this combination is connected in series with ...
2年弱 前
解決済み
Orthonormal matrix
You decide whether any given matrix is an orthonormal matrix or not.
If each column in a matrix is perpendicular to the other...
2年弱 前
解決済み
Nilpotent matrix
Check if matrix A is
<http://mathworks.com/ nilpotent>.
2年弱 前
解決済み
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...
2年弱 前
解決済み
Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...
2年弱 前
解決済み
Number of 1s in a binary string
Find the number of 1s in the given binary string.
Example. If the input string is '1100101', the output is 4. If the input stri...
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...
約2年 前
解決済み
Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.
約2年 前
解決済み
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to <http://www.mathworks....
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...
約2年 前
解決済み
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...