A résolu


Eliminate unnecessary polygon vertices
Suppose you have an n-point polygon represented as an n-by-2 matrix of polygon vertices, P. Assume that the polygon is closed; t...

environ 10 ans il y a

A résolu


Find Rotated Substring
Given a string s1, find if a rotated version of s1 is present in a second string s2. For example, rotated version of some str...

environ 10 ans il y a

A résolu


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

environ 10 ans il y a

A résolu


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

environ 10 ans il y a

A résolu


Do you like your boss?
Do you like your boss? Answer can be any string! For example: Boss = 'Do you like your boss?'; Output = 'yes' or ...

environ 10 ans il y a

A résolu


07 - Common functions and indexing 6
Create a variable _m_ as a magic square with the size 6 x 6 Magic squares are defined as square matrices, where the sum of a...

environ 10 ans il y a

A résolu


04 - Scalar Equations 1
Define the variable a: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> Use this to calculate x: <<http://samle.dk/STTBD...

environ 10 ans il y a

A résolu


Celcius to Kelvin
Convert Celsius degrees to Kelvin temperature.

environ 10 ans il y a

A résolu


Rounding
Round 10.67 and make 'y' equal to that number.

environ 10 ans il y a

A résolu


03 - Matrix Variables 5
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

environ 10 ans il y a

A résolu


03 - Matrix Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3b.png>> A 9x9 matrix of zeros, but with the following v...

environ 10 ans il y a

A résolu


02 - Vector Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2d.png>> (Logarithmically spaced numbers between 1 and 1...

environ 10 ans il y a

A résolu


Function definition: BMI calculator
Define a function CalculateBMI with inputs massKg and heightCm. The function returns bodyMassIndex. The function should be able ...

environ 10 ans il y a

A résolu


02 - Vector Variables 5
_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

environ 10 ans il y a

A résolu


02 - Vector Variables 3
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2c.png>> (all the numbers from 5 to -5 in increments of ...

environ 10 ans il y a

A résolu


02 - Vector Variables 1
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2a.png>>

environ 10 ans il y a

A résolu


Logical operators: Flipping bits
The xor operator will toggle the bit if the bit is xored with 1. Ex: 1 XOR 0 = 1, 1 XOR 1 = 0. The xor operator will retain th...

environ 10 ans il y a

A résolu


Constructing strings
* Construct a string alphaString from 'a' to endLetter, using the double colon operator. Ex: If endLetter = 'e', then alphaSt...

environ 10 ans il y a

A résolu


Logical operators and arrays: 3-input and truth table
Given 3 inputs (inputA, inputB, inputC), assign threeInputAnd with the truth table outcomes for a 3 variable logical-and operati...

environ 10 ans il y a

A résolu


Logical variables: Running late?
* Assign onTime with true if noTraffic is true and gasEmpty is false.

environ 10 ans il y a

A résolu


Nth root.
* Assign outValues with the nth root of the inValues, the root is specified by rootValue

environ 10 ans il y a

A résolu


Indexing the array: Shift right with variable sized arrays
* Write a statement to shift the array contents 1 position to the left. * Assign the rightmost element with -1. Ex: [12, 85...

environ 10 ans il y a

A résolu


Relational operators and row arrays: Run times
* Construct a row array fastRunTimes containing all elements of runTimes equal to or less than 480 seconds. Ex: If runTimes =...

environ 10 ans il y a

A résolu


Multiple element-wise operations: Percent change
Row arrays sales2013 and sales2014 reflect the quarterly sales (in millions) of a popular potato chip company. Write a statement...

environ 10 ans il y a

A résolu


Extracting data: Heart rate (pulse)
The resting heart rate for an average adult is 60 - 100 beats per minute. Assign row array heartExtracted with all values in row...

environ 10 ans il y a

A résolu


Constructing column arrays
* Construct a column array elevatorStops with values 2, 4, 5, 9, and 10

environ 10 ans il y a

A résolu


Column arrays: Transpose a row array
* Construct a row array countValues with elements 1 to endValue, using the colon operator. * Transpose countValues to result in...

environ 10 ans il y a

A résolu


Function call in expression: Reduced pricing.
Write a single statement that assigns cartTotal with the discounted cost of items 1 and 2. Function DiscountedPrice will return ...

environ 10 ans il y a

A résolu


Adding an element: Ticker tape
* Add stockPrice to the beginning of row array tickerTape

environ 10 ans il y a

A résolu


Variable sized row arrays
* Reverse the contents of row array mileMarkers

environ 10 ans il y a

Charger plus