Community Profile

# James

2,710 total contributions since 2012

View all

Contributions in
View by

Solved

How to reverse spdiags ?
The spdiags function extracts all nonzero diagonals from the m-by-n matrix A. So if A=[1 2 3;4 5 6;7 8 9], spdiags(A)=[7 4...

4 days ago

Solved

Funny problems
Generate the following vector： if n=1 then q=1; elseif n=2 then q=[2 2 1]; elseif n=3 then q=[3 3 3 2 2 1]; ... end

11 days ago

Solved

Pattern Sum
Write a function which receives two single digit positive integers, (k and m) as parameters and calculates the total sum as: k...

15 days ago

Solved

There are four cars starting at a point. The first car points north, the second one points east, the third one points south, an...

15 days ago

Solved

Happy Free March!
Just submit your solution in any March. *Related Challenges:* # <https://www.mathworks.com/matlabcentral/cody/problems/445...

15 days ago

Solved

read and return the following word. 'M M A TTTTTTTTTL A BBB ' 'MM MM A A T L ...

16 days ago

Solved

2) Are you more familiar with iteration methods or Linear Algebra ? Let's see together.
Referring to problem: https://www.mathworks.com/matlabcentral/cody/problems/44530-are-you-more-familiar-with-iteration-method...

17 days ago

Solved

Are you more familiar with iteration methods or Linear Algebra? Let's see together.
Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equa...

17 days ago

Solved

Separate even from odd numbers in a vector - without loops
*Without using loops*, rearrange a vector of integers such that the odd numbers appear at the beginning, and even numbers at the...

18 days ago

Solved

Horizontal matrix sort
Given a matrix x with n rows and m columns, return a matrix y with n rows and 2m columns, such that every row in x is sorted fro...

18 days ago

Solved

The cake is a lie...
You're hosting a birthday party with a large number of screaming children. Fortunately, you have a gigantic sheet cake in front...

29 days ago

Solved

Radiation Heat Transfer — View Factors (5)
View factors (aka configuration factors) are utilized in some radiation heat transfer models to estimate heat transfer rates bet...

1 month ago

Solved

Generate a melodic contour string matrix
<http://en.wikipedia.org/wiki/Parsons_code Parsons code> is a surprisingly effective way to identify music by its melodic motion...

1 month ago

Solved

Morse Code Generator! Try it!
.... . .-.. .-.. --- . ...- . .-. -.-- --- -. . -.-.-- .-.. . - ... -.. --- ... --- -- . -- --...

1 month ago

Solved

Eliminate Polysyllabics: Long live short words!
Given a string s1, return s2 in which all the words with more than one syllable have been removed. To make things simple, we ...

1 month ago

Solved

longest common substring : Skipped character version
Two strings are given. Find the longest common substring between them. The substring characters need not be adjacent. They, howe...

1 month ago

Solved

Happy Free 15th Day of a Month!
Just submit your solution on 15th day of any month. *Related Challenges:* # <https://www.mathworks.com/matlabcentral/cody/...

1 month ago

Solved

Convex Hull Capture
Imagine four points in uv that form a square. uv = [ ... 0,0; 0,2; 2,2; 2,0]; Now we have two more po...

1 month ago

Solved

What is the next step in Conway's Life?
Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

1 month ago

Solved

Happy Free Wednesday!
Just submit a solution on any Wednesday. *Related Challenges:* # Happy Free Wednesday! # <https://www.mathworks.com/matl...

1 month ago

Solved

Under the sea: Snell's law & total internal reflection
<https://en.wikipedia.org/wiki/Snell's_law> When a light travels from one medium to another medium, depending on the refracti...

1 month ago

Solved

The great 82-year-old
Let's answer the question below; 'I am *x* years old and I have never written programs. If I study from now, will I be able ...

1 month ago

Solved

Find the starting index of a consecutive condition
Given a logical vector |v|, and a positive integer |n|, return the smallest index |i| that satisfies: all( v(i : i+n-1) ) =...

1 month ago

Solved

Please check if calorie intake is less than 300 kcal.
I like eating some puddings and some chocolate cookies around 3 o'clock. However, I care about calorie intake. Please check whe...

1 month ago

Solved

It's Happy! It's Fun! It's Happy Fun Hyperball!
Yes, it's Happy Fun Hyperball! The CODY sensation that's sweeping MATLAB nation! All you need to do to get your free Happy Fun H...

2 months ago

Problem

It's Happy! It's Fun! It's Happy Fun Hyperball!
Yes, it's Happy Fun Hyperball! The CODY sensation that's sweeping MATLAB nation! All you need to do to get your free Happy Fun H...

2 months ago | 0

Solved

Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

2 months ago

Solved

Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

2 months ago

Solved

Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

2 months ago

Solved

Some Assembly Required
The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...

2 months ago