A résolu


Laws of motion 1

plus de 2 ans il y a

A résolu


Laws of motion 2

plus de 2 ans il y a

A résolu


Laws of motion 3

plus de 2 ans il y a

A résolu


Laws of motion 4
Given the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.

plus de 2 ans il y a

A résolu


Laws of motion 5

plus de 2 ans il y a

A résolu


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

plus de 2 ans il y a

A résolu


Inner product of two vectors
Find the inner product of two vectors.

plus de 2 ans il y a

A résolu


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

plus de 2 ans il y a

A résolu


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

plus de 2 ans il y a

A résolu


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

plus de 2 ans il y a

A résolu


Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

plus de 2 ans il y a

A résolu


Back to basics 13 - Input variables
Covering some basic topics I haven't seen elsewhere on Cody. Return as a string the name of the input variable to the functio...

plus de 2 ans il y a

A résolu


y equals x divided by 2
function y = x/2

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

plus de 2 ans il y a

A résolu


Program an exclusive OR operation with logical operators
Program an exclusive or operation *without* using the MATLAB function xor. Use logical operators like |, &, ~, ... instead. ...

plus de 2 ans il y a

A résolu


A matrix of introverts
You are given a matrix full of numbers who happen to be very shy. Write a MATLAB function that will put a square of zeros aroun...

plus de 2 ans il y a

A résolu


Sum the 'edge' values of a matrix
Sum the 'edge' values of an input matrix (the values along the perimeter). Example [1 2 3 4 5 6 7 8 9] Output = ...

plus de 2 ans il y a

A résolu


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

plus de 2 ans il y a

A résolu


BaeIsAlwaysRight
Output yes whatever bae says

plus de 2 ans il y a

A résolu


Display negative numbers
Given array,x, display all the negative numbers and display output as y. Example x=[1 -2 3 -4] , output is y=[-2 -4].

plus de 2 ans il y a

A résolu


Annoying population
Every year the number of annoying persons in the office triples Found the population, given a(0) and t

plus de 2 ans il y a

A résolu


Create a code for XNOR
Given two inputs, output XNOR of those two

plus de 2 ans il y a

A résolu


Create tangent function out of sine function only
Please don't use cosine and tangent functions

plus de 2 ans il y a

A résolu


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

plus de 2 ans il y a

A résolu


Linear system of equations
Solve the system of equations in three variables.

plus de 2 ans il y a

A résolu


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

plus de 2 ans il y a

A résolu


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

plus de 2 ans il y a

A résolu


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

plus de 2 ans il y a

A résolu


Total energy

plus de 2 ans il y a

Charger plus