BS Chemical Engineering (2012), University of the Philippines - Diliman

MS Chemical Engineering (2015), University of the Philippines - Diliman

PhD Energy (Present), Cranfield University, UK

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

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

7 days ago

Solved

Solving a quadratic equation

Given a, b and c, Return the solution of the following quadratic equation: a*x^2 + b*x + c = 0.

7 days ago

Solved

Divisors of an integer

Given a number N, return a vector V of all integers that divide N. For example, N = 10 Then V=[1 2 5 10]

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

7 days ago

Solved

Create an anti-identity matrix

Create an anti-identity matrix of given dimension. Examples n = 2 A = [0 1; 1 0] n = 3 A = [0 0 1; 0 1 0; 1 0 0...

7 days ago

Solved

Change string to number

Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

7 days ago

Solved

Calculate area of sector

A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

7 days ago

Solved

Multiply by 3

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

7 days ago

Solved

Matlab Basics - Rounding I

Write a script to round x DOWN to the next lowest integer: e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2

7 days ago

Solved

sum of non-primes

The sum of the non-primes no larger than 10 is 1+4+6+8+9+10=38 Find the sum of all the positive non-prime integers that do no...

7 days ago

Solved

CONVERT TAN TO SIN

In a right angle triangle ABC given the tan(A) then find sin(A) For example tan(A)=3/4 then sin(A)=3/5

7 days ago

Solved

Matrix with different incremental runs

Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

7 days ago

Solved

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

7 days ago

Solved

intersection of matrices

Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

7 days ago

Solved

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

7 days ago

Solved

Target sorting

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

7 days ago

Solved

vectorization in N

For a given integer n (n>1), compute the sum f (i) (1 <= i <= n) where f (i) = 1 if n is odd and 2 otherwise.

7 days ago

Solved

Find the nearest integer

Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

7 days ago

Solved

Encode Roman Numerals

Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

7 days ago

Solved

Knight's Tour Checker

Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

7 days ago

Solved

01 - Scalar variables

Create the following variables: <<http://samle.dk/STTBDP/Assignment1_1.png>>

8 days ago

Solved

All capital?

Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

8 days ago

Solved

Ripping numbers apart!

So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

8 days ago

Solved

Decode a simplified barcode

Given a bar code from this <http://www.mathworks.com/matlabcentral/cody/problems/602-make-a-simplified-bar-code exercise>: Re...

8 days ago