Matlab Basics - Logical Tests I
Write a script to test whether a year number is for a leap year or not.
eg. x = 1884
output = 1
eg. x = 3
output = 0
4年弱 前
解決済み
Matlab Basics II - Log and natural log
Write a function that calculates the difference between the log and natural log of a vector, to two decimal places
example:
...
4年弱 前
解決済み
Matlab Basics II - squares
Write a function that takes matrix A, and squares each element in the matrix
example:
A = [1 2 3]
output = [1 4 9]
4年弱 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
4年弱 前
解決済み
Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x
e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]
4年弱 前
解決済み
Matlab Basics - Assigning Variables
Assign different types of data to variables: integer, double, and strings
Example:
A is a double, for example 2.34
B is a...
Basic Mathematics 3
It was announced during a Robotics Competition kick off that two of the trickiest scoring objects are: soup cans, and beach ball...
4年弱 前
解決済み
Calculate Parallel Resistance
Three resistors connected in parallel have resistances R1, R 2, and R 3, respectively. Return the total resistance R total of ...
4年弱 前
解決済み
Basic Mathematics 7
Three generous robotics team mentors would jointly like to donate $N toward extra supplies. The second mentor is donating twice ...
metre to feet converter
The idea is to make a converter, which exchange meters to feets.
We use a factor of 1m = 3.281*1f.
so 3m are equals to 9.843 m...
Integer or Float?
Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise ret...
4年弱 前
解決済み
Area of a disk
Find the area of a disk or circle.
x= radius of the disk.
4年弱 前
解決済み
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...
Make roundn function
Make roundn function using round.
x=0.55555
y=function(x,1)
y=1
y=function(x,2)
y=0.6
y=function(x,3)
...
4年弱 前
解決済み
Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000
e.g. x = 12,358,466,243 --> y = 12,358,470,000
4年弱 前
解決済み
Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...
4年弱 前
解決済み
MATLAB Basic: rounding IV
Do rounding towards plus infinity.
Example: -8.8, answer -8
+8.1 answer 9
+8.50 answer 9
4年弱 前
解決済み
MATLAB Basic: rounding III
Do rounding towards minus infinity.
Example: -8.8, answer -9
+8.1 answer 8
+8.50 answer 8
square root
Find the square root (y) of an input (x).
4年弱 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.
4年弱 前
解決済み
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...