Risolto


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

oltre 6 anni fa

Risolto


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

oltre 6 anni fa

Risolto


QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a <http://en.wikipedia.org/wiki/Keyboa...

oltre 6 anni fa

Risolto


reverse string
input='rama' output='amar'

oltre 6 anni fa

Risolto


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

oltre 6 anni fa

Risolto


Multiply by 3
Given the variable x as your input, multiply it by three and put the result in y.

oltre 6 anni fa

Domanda


How can the code memorize the generated vector?
Is there a quick way to memorize the generated out matrix in each iteration? in1=[1 8 12] in2=[4 5 9] out=[] coun...

oltre 6 anni fa | 1 risposta | 0

1

risposta

Risolto


Rotate a Matrix
Input a Matrix x, Output y is the matrix rotating x 90 degrees clockwise

oltre 6 anni fa

Risolto


Smallest distance between a point and a rectangle
Given two points *x* and *y* placed at opposite corners of a rectangle, find the minimal euclidean distance between another poin...

oltre 6 anni fa

Risolto


Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

oltre 6 anni fa

Risolto


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

oltre 6 anni fa

Risolto


Time Expansion
How can you slow down any discrete-time signal? Example Input original signal x. x = [1 2 3 -1 -2 -5 -4] We want t...

oltre 6 anni fa

Risolto


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

oltre 6 anni fa

Risolto


NO _________ ALLOWED....
So you're given a sentence where if there is a particular word in the sentence then the output is 1, if it is not there then the...

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


How unique?
Sometimes, when we check unique entries of vector we would like to know how many times each value occurs. Given vector of num...

oltre 6 anni fa

Risolto


Replace pattern 0 1 0 and 1 0 1
Find and replace a pattern in a row of zeroes and ones. * Find 1 0 1 and replace it with 1 1 1 * Find 0 1 0 and replace it w...

oltre 6 anni fa

Risolto


Volume of a Parallelepiped
Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

oltre 6 anni fa

Risolto


Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

oltre 6 anni fa

Domanda


Shifting letters by two positions. What's wrong with the code?
I am trying to shift each letter of a given word by two positions. alphab='abcdefghijklmnopqrstwxyz' inStr = 'doug'; ...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Risolto


Circumscribed circles
Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

oltre 6 anni fa

Risolto


What is the distance from point P(x,y) to the line Ax + By + C = 0?
Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

oltre 6 anni fa

Risolto


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

oltre 6 anni fa

Risolto


Fill a zeros matrix
The aim is to fill an array of all zeros given a numerical value and the index of row and columns for this value. 3 Inputs: ...

oltre 6 anni fa

Domanda


What wrong with the indexing code?
If I want to fill in a matrix, of which I have its indices without a for loop, how could I do it? Suppose that the (row(i),col(...

oltre 6 anni fa | 2 risposte | 0

2

risposte

Risolto


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

oltre 6 anni fa

Risolto


Return area of square
Side of square=input=a Area=output=b

oltre 6 anni fa

Risolto


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

oltre 6 anni fa

Carica altro