Community Profile

Contact

Top 1% contributor

fun = @(x,y) x + x.*y; N = 1e3; K = zeros(N); for i = 1:N for j = i:N K(i,j) = fun(i, j); end end

2 Answers

0

Asked 2 years ago

For example: f = @(x1, x2, ... , x15) x1 .* x2 .* ... .* x15 I want get: f = @(x) x(1,:) .* x(2,:) .* ... .*x(15,:)

Asked 3 years ago

*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

Solve this!

2 years ago

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

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

Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

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

Given a vector x, the output y should equal the length of x.

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

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

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

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

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

Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...

*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

Given a vector of lengths [a b c], determines whether a triangle with non-zero area (in two-dimensional Euclidean space, smarty!...

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

Covering some basic topics I haven't seen elsewhere on Cody. Return the largest positive integer MATLAB can handle.

Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

3 years ago

Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector of numbers, output a square array with the...

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

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

1:3 -> 0; 3:5 -> 6

Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

Load more

Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend you select United States from the following list:

See all countries