Solved

Back to basics 26 - Keywords

Covering some basic topics I haven't seen elsewhere on Cody. Return a cell array of strings of all MATLAB keywords.

casi 5 años ago

Solved

03 - Matrix Variables 5

Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3e.png>>

casi 5 años ago

Solved

02 - Vector Variables 5

_eVec_ = _Hello_ ( _eVec_ is a string, which is a vector of characters )

casi 5 años ago

Solved

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

casi 5 años ago

Solved

02 - Vector Variables 4

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

casi 5 años ago

Solved

Back to basics 25 - Valid variable names

Covering some basic topics I haven't seen elsewhere on Cody. Given a string, return true if it is a valid MATLAB variable nam...

casi 5 años ago

Solved

Magic!

Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

casi 5 años ago

Solved

The Answer to Life, the Universe, and Everything

A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

casi 5 años ago

Solved

Number of 1s in the Binary Representation of a Number

*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

casi 5 años ago

Solved

Constructing column arrays

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

casi 5 años ago

Solved

Create a square matrix of multiples

Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

casi 5 años ago

Solved

Make a 1 hot vector

Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

casi 5 años ago

Solved

give nth decimal place of pi

max 15th place after the decimal point is ok for now

casi 5 años ago

Solved

Adding an element: Ticker tape

* Add stockPrice to the beginning of row array tickerTape

casi 5 años ago

Solved

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

casi 5 años ago

Solved

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

casi 5 años ago

Solved

Logic array: Identifying qualifying times

Create a logic array qualifyingIndex with true for any location where the runner is male with a running time less than 8.2. Row ...

casi 5 años ago

Solved

03 - Matrix Variables 1

Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

casi 5 años ago

Solved

Back to basics 1 - Saving

Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

casi 5 años ago

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector

Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

casi 5 años ago

Solved

Getting the indices from a matrice

Getting the indices from a matrice. Inspired by Problem 645. Getting the indices from a vector by the great Doug Hull. Given a...

casi 5 años ago

Solved

We love vectorized solutions. Problem 1 : remove the row average.

Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

casi 5 años ago

Solved

Remove the two elements next to NaN value

The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

casi 5 años ago

Solved

Reindex a vector

You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

casi 5 años ago

Solved

middleAsColumn: Return all but first and last element as a column vector

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

casi 5 años ago

Solved

Generate N equally spaced intervals between -L and L

Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

casi 5 años ago

Solved

First non-zero element in each column

For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

casi 5 años ago