Community Profile

Contact

Top 1% contributor

I think this does what you want. HH=cell2mat(arrayfun(@(k) circshift(d(:,k),k),1:size(d,2),'uni',0)) HH = ...

accepted

1

Answered 5 months ago

Write a function a that takes a date vector as an input and returns the number of hours until the weekend begins. The beginning...

Solve this!

0

1 year ago

Well, I learned a new trick today. My method works on arrays without singleton dimensions and can be extended to 3-D or more, b...

2248 views

Responded 2 years ago

It looks like what you want to do is similar to the kron function that Matlab has for multiplication. Try using this code, whic...

If you want to keep your for loop, you can do it like this: d=[]; for k=1:length(b) end This appends the next set of numbers t...

2210 views

It's not clear what you need *a* for. You can make *d* directly from *c* and *b* as follows: >> d=b(c) d = ...

2

I think your for loop is only getting data off the top page of the array. When I run your code, B is [ni 1], but all the others...

To restate what you posted, you have a set of data consisting of _(value, input_time)_ pairs. At some interval, you want to rep...

Answered 2 years ago

Am I the only one getting annoyed by Zyante's recent flooding of Cody? In the past week or two, they've posted 30-40 problems, ...

659 views

Posted 9 months ago

<http://en.wikipedia.org/wiki/Rumis Rumis> is a multiplayer 3D block board game where the goal is to have the most squares visib...

5 months ago

Check whether the input matrix is a normal magic square: <http://en.wikipedia.org/wiki/Magic_square> Output the logical va...

7 months ago

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

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

Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

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

Omit columns averages from a matrix. For example: A = 16 2 3 13 5 11 10 8 9 7 ...

Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

Find the base _b_ logarithm of the input decimal number _x_. Express the output as a decimal number. The first argument is the n...

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

Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component. Examp...

for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice. Ex...

This is a sub problem related to this problem: <http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...

Just like Matthew's problem <http://www.mathworks.com/matlabcentral/cody/problems/2793 2793> and Edward's problem <http://www.ma...

Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

Load more