Top 1% contributor
I think this does what you want.
Answered 10 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...
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...
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...
It's not clear what you need *a* for. You can make *d* directly from *c* and *b* as follows:
Answered 11 months ago
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, ...
1 year ago
A simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The ta...
11 months ago
Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2...
This problem is very similar to <https://www.mathworks.com/matlabcentral/cody/problems/3101-rumis-scorer-3 Rumis Scorer 3>. The ...
<http://en.wikipedia.org/wiki/Rumis Rumis> is a multiplayer 3D block board game where the goal is to have the most squares visib...
Check whether the input matrix is a normal magic square:
Output the logical va...
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.
Given the string a, find the longest palindromic sub-string b.
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.
Input x = 10
Output y is 12
Omit columns averages from a matrix.
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.
Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a location from the following list:
See all countries