해결됨

MATLAB Basic: rounding II

Do rounding nearest integer. Example: -8.8, answer -9 +8.1 answer 8 +8.50 answer 9

12달 전

해결됨

Unit Matrix

Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

12달 전

해결됨

Doubling elements in a vector

Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

12달 전

해결됨

Say something funny

Say something funny, or not. Your solution will be (fully automatically and objectively) scored based on how clever or funny ...

12달 전

해결됨

Determine Whether an array is empty

Input a matrix x, output y is TRUE if x is empty, otherwise FALSE.

12달 전

해결됨

Rotate a Matrix by 90 degrees

Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

12달 전

해결됨

Number of Horns on a unicorn!

Calculate the number of horns on a *unicorn*! And I'm talking about a unicorn with not more than one horn on it!

12달 전

해결됨

Divide by 4

Given the variable x as your input, divide it by four and put the result in y.

12달 전

해결됨

Compute a dot product of two vectors x and y

x and y are input vectors, d is a number and contains their dot product

12달 전

해결됨

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

12달 전

해결됨

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

12달 전

해결됨

The Hitchhiker's Guide to MATLAB

Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

12달 전

해결됨

Convert given decimal number to binary number.

Convert given decimal number to binary number. Example x=10, then answer must be 1010.

12달 전

해결됨

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

12달 전

해결됨

Tell me the slope

Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

12달 전

해결됨

Get the length of a given vector

Given a vector x, the output y should equal the length of x.

12달 전

해결됨

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

12달 전

해결됨

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

12달 전

해결됨

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

12달 전

해결됨

Simple equation: Annual salary

Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

12달 전

해결됨

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

12달 전

해결됨

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

12달 전

해결됨

Check if number exists in vector

Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

12달 전

해결됨

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

12달 전