184 total contributions since 2009

http://sites.google.com/site/workofap/

Professional Interests: Graphics, Embedded Systems

Submitted

Euler spiral

This script plots Euler spiral and some of its variants.

2 years ago | 7 downloads |

Submitted

Mandelbrot set and Julia set

Function generates Mandelbrot set and Julia set fractal.

2 years ago | 23 downloads |

Solved

Alphabetize by last name

Given a list of names in a cell array, sort the list by the last name. So if list = {'Barney Google','Snuffy Smith','Dagwood ...

5 years ago

Solved

Read a Soroban Abacus

*Description* The Soroban is the name of the modern Japanese abacus. Information on reading a Soroban can be found <http://we...

6 years ago

Solved

Set the array elements whose value is 13 to 0

Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

6 years ago

Solved

Renaming a field in a structure array

MATLAB has a <http://www.mathworks.com/help/techdoc/ref/setfield.html setfield> and a <http://www.mathworks.com/help/techdoc/ref...

6 years ago

Solved

Rotate a Matrix

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

6 years ago

Solved

Flip the main diagonal of a matrix

Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

6 years ago

Solved

Which quadrant?

Given a complex number, output quadrant 'I' 'II' 'III' or 'IV' | II | I | ...

6 years ago

Solved

Back to basics 17 - white space

Covering some basic topics I haven't seen elsewhere on Cody. Remove the trailing white spaces from the input variable

6 years ago

Solved

Rotate a Matrix by 90 degrees

Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

6 years ago

Solved

Multiply a column by a row

* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

6 years ago

Solved

Find the largest value in the 3D matrix

Given a 3D matrix, A, find the largest value. E.g. >> A = 1:9; >> A=reshape(A,[3 1 3]); >> islargest(A) ans = 9

6 years ago

Solved

Back to basics 10 - Max Float

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive floating-point number MATLAB can han...

6 years ago

Solved

Back to basics 9 - Indexed References

Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix and row and column, output the index of th...

6 years ago

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

6 years ago

Solved

Remove NaN ?

input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

6 years ago

Solved

Is my wife right? Now with even more wrong husband

Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

6 years ago

Solved

Duplicates

Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

6 years ago

Solved

Which doors are open?

There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

6 years ago

Solved

Project Euler: Problem 8, Find largest product in a large string of numbers

Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

6 years ago

Solved

Find state names that start with the letter N

Given a list of US states, remove all the states that start with the letter N. If s1 = 'Alabama Montana Nebraska Vermont Ne...

6 years ago

Solved

Find the two-word state names

Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

6 years ago

Solved

Find state names that end with the letter A

Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

6 years ago