Make a vector of prime numbers
Input(n) - length of vector with prime numbers
Output(v) - vector of prime numbers
Example:
* n=1; v=2
* n=3; v=[2 3 5...
5ヶ月 前
解決済み
"mirror" matrix
Create n x 2n "mirror" matrix of this type:
Examples
For n = 2
m = [ 1 2 2 1
1 2 2 1 ]
For n = 3
m = ...
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346
6ヶ月 前
解決済み
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...
6ヶ月 前
解決済み
MATLAB Basic: rounding III
Do rounding towards minus infinity.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 8
6ヶ月 前
解決済み
MATLAB Basic: rounding II
Do rounding nearest integer.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 9
6ヶ月 前
解決済み
MATLAB Basic: rounding IV
Do rounding towards plus infinity.
Example: -8.8, answer -8
+8.1 answer 9
+8.50 answer 9