Resuelto


Coordinate geometry
Assign pointsDistance with the distance between point (x1, y1) and point (x2, y2). The distance is calculated by: Distance =...

más de 8 años hace

Resuelto


Double colon operator: Counting up
* Construct a row array countValues from 1 to endValue, using the double colon operator. Ex: If endValue is 5, countValues s...

más de 8 años hace

Resuelto


Character variable: Compass direction
* Assign compassDirection with sensorReading's value. Both are character variables.

más de 8 años hace

Resuelto


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....

más de 8 años hace

Resuelto


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

más de 8 años hace

Resuelto


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

más de 8 años hace

Resuelto


Project Euler: Problem 10, Sum of Primes
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below the input, N. Thank you <http:/...

más de 8 años hace

Resuelto


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

más de 8 años hace

Resuelto


Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

más de 8 años hace

Resuelto


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

más de 8 años hace

Resuelto


Compute LOG(1+X) in natural log
Compute LOG(1+X) in natural log

más de 8 años hace

Resuelto


Evaluate Polynomial
Given a polynomial equation coefficients in a vector p, you have to return its value at x. Example: For inputs p and x ...

más de 8 años hace

Resuelto


Vector Magnitude Calculator
'a' is a vector that starts at the origin and ends at (x, y). Find ||a||. Hint: It is as simple as "ABC".

más de 8 años hace

Resuelto


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...

más de 8 años hace

Resuelto


Matlab Basics II - Max & Index of Max
Write a function that takes a vector x, then returns both the max value in x and its location in the vector for example x ...

más de 8 años hace

Resuelto


Are you in XY plane?
Take a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0. Example...

más de 8 años hace

Resuelto


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...

más de 8 años hace

Resuelto


Writing a nested function: BMI calculation
Write a nested function CalculateBMI that assigns bmiValue given a user's weight and height. Use the following equations to calc...

más de 8 años hace

Resuelto


Modify an array's elements
Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. ...

más de 8 años hace

Resuelto


Matlab Basics - Pick out parts of a vector
Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

más de 8 años hace

Resuelto


While loop with branching
Write a while loop that adjusts userValue while userValue is less than 0 or greater than 80. If userValue is greater than 80, th...

más de 8 años hace

Resuelto


Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

más de 8 años hace

Resuelto


Сoncatenate two strings.
Сoncatenate two strings. Example s1='Hello' s2='world' result='Hello world'

más de 8 años hace

Resuelto


Reverse digits of a number
Reverse digits of a number. For example, return *321* for the input *123* . The left-hand zeros can be discarded. For exam...

más de 8 años hace

Resuelto


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

más de 8 años hace

Resuelto


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...

más de 8 años hace

Resuelto


Change string to number
Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

más de 8 años hace

Resuelto


Nth root
Nth root of a number x

más de 8 años hace

Resuelto


Is it prime?
Given a number, check whether it is prime or not. If prime output is true, otherwise false.

más de 8 años hace

Resuelto


Save variables
a=[1] Save variable a that is located in workspace into current folder. File name should be 'a.mat'

más de 8 años hace

Cargar más