Solved


Weighted average
Given two lists of numbers, determine the weighted average as follows Example [1 2 3] and [10 15 20] should result in 33.3...

nästan 3 år ago

Solved


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

nästan 3 år ago

Solved


Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

nästan 3 år ago

Solved


Building matrices
If you have matrix A, create matrix B using matrix A as an "element" A = [1 2 3 4; 5 6 7 8...

nästan 3 år ago

Solved


03 - Matrix Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

nästan 3 år ago

Solved


pressure to dB?
given x ratio of pressure, find corresponding y dB

nästan 3 år ago

Solved


Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

nästan 3 år ago

Solved


Rounding off numbers to n decimals
Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point numb...

nästan 3 år ago

Solved


Solve the Sudoku Row
*Description* A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...

nästan 3 år ago

Solved


06 - Matrix Equations 3
Define the matrices _aMat_, _bMat_, and _cMat_: <<http://samle.dk/STTBDP/Assignment1_3a.png>> ( _aMat_ = 9x9 matrix full o...

nästan 3 år ago

Solved


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

nästan 3 år ago

Solved


Matlab Basics - Create a row vector
Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

nästan 3 år ago

Solved


Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

nästan 3 år ago

Solved


07 - Common functions and indexing 4
Define the matrix _cMat_: <<http://samle.dk/STTBDP/Assignment1_3c.png>> ( _cMat_ = 10x10 matrix where the numbers from 1 t...

nästan 3 år ago

Solved


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

nästan 3 år ago

Solved


Sorted highest to lowest?
Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

nästan 3 år ago

Solved


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

nästan 3 år ago

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

nästan 3 år ago

Solved


Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

nästan 3 år ago

Solved


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

nästan 3 år ago

Solved


Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody. Return a string that is the user's portion of the current search...

nästan 3 år ago

Solved


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

nästan 3 år ago

Solved


Who invented zero?
We know the importance zero in computer science, mathematics... but who invented zero? Clue: He was the first in the line ...

nästan 3 år 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...

nästan 3 år ago

Solved


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

nästan 3 år ago

Solved


High school cafeteria
Given an input vector of positive integers, return a row vector with the primes first (in increasing order) and the composites n...

nästan 3 år ago

Solved


Geometric series
Find the sum, given the first term t1, the common ratio r, and number of terms n. Examples If input t1=1, r=1, n=7 the...

nästan 3 år ago

Solved


find the maximum element of the matrix
for e.g x = [1 2; 3 4] y = 4

nästan 3 år ago

Solved


Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

nästan 3 år ago

Solved


Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.

nästan 3 år ago

Load more