Solved


Non trivial identities - reshape
Return x by reshaping it.

6 years ago

Solved


Non trivial identities - summation
Return x by adding a random number to it.

6 years ago

Solved


Union Jack Matrix
Create a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square ...

6 years ago

Solved


Vandermonde Matrix
Create the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column i...

6 years ago

Solved


A shooting competition
In a shooting competition, the target is a square of side L containing a circle of radius R<=L/2. A player scores one point if h...

6 years ago

Answered
how can i solve this matlab
Look at mod() function C(mod(C,2)==1)

6 years ago | 0

Solved


Find the solution of algebraic equation
Find the solution of algebraic equation of the form an*x^n + a(n-1)*x^(n-1) + (an-2)*x^(n-2)+...... a2*x^2 + a1*x^1 + a0 = 0;...

6 years ago

Solved


Alternate list of elements
Write a function that combines two lists by alternating the elements, e.g. ['a','b','c'], ['1','2','3'] → 'a1b2c3'.

6 years ago

Solved


Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

6 years ago

Answered
Blackjack: I want to know how to get new cards and keep the old ones every time I hit the HIT button
You could look at other people's Blackjack code. Here is one that I wrote: https://www.mathworks.com/matlabcentral/fileexchange...

6 years ago | 0

Answered
All combinations not being generated
perms(A);

6 years ago | 0

Solved


Evaluate the zeta function for real arguments > 1
The <https://en.wikipedia.org/wiki/Riemann_zeta_function Riemann zeta function> is important in number theory. In particular, th...

6 years ago

Solved


Set Soldner's constant

6 years ago

Solved


Create cell array of numeric arrays
Convert the input to a cell array, but only if necessary. If the input is a numeric array, return a 1-by-1 cell array contain...

6 years ago

Answered
sum of row in pattern
k=unique(Data(:,1:2)); y=zeros(length(k),2); for m=1:length(k) y(m,:)=[k(m),sum(Data(logical(ismember(Data(:,1),k(m))+ism...

6 years ago | 0

Solved


Determine digits of the Copeland-Erdos constant
<https://www.mathworks.com/matlabcentral/cody/problems/1477-champernowne-constant/solutions/new Cody Problem 1477> asks us to de...

6 years ago

Solved


Cumulative difference
Given an array, return the cumulative difference. Example a = [ 1 3 5 7 ] cumdiff = [ 1 2 1 -2 ]

6 years ago

Solved


Find index of a string in a cell array
Write a function that finds the index at which the cell array of strings C contains the exact string S. So if C = {'twe...

6 years ago

Solved


basic matrix operations: rotate and find sum of diagonal elements of the resultant matrix
For given input matrix a, rotate it by 90 degrees and find the sum of the diagonals. Example: Input: a = 1 ...

6 years ago

Solved


Basic Addition

6 years ago

Solved


S-T-R-E-T-C-H I-T O-U-T
You will be given a row of numbers (x), and a single number (n). Your job is to write a script that will stretch out the row of...

6 years ago

Solved


Given a number N, find the smallest prime P>N
Given a number N, find the smallest prime P greater than N. For example: If N=10 then P=11. If N=13 then P=17.

6 years ago

Solved


Weave two matrices together to form one matrix
Take the first column from matrix a, then insert the first column from matrix b, and so on. For example: a = [1 2 3 4]; b ...

6 years ago

Solved


Make a Plot with Functions
Make a plot and test

6 years ago

Solved


means
Calculate the arithmetic, the geometric and the harmonic mean of a given vector (with positive elements) and return them in a ve...

6 years ago

Solved


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

6 years ago

Solved


User defined nextpow function
Create a function which will take 2 arguments as n and x, and return y, where, n^y >= abs(x). [ Similar to builtin "nextpow2" fu...

6 years ago

Solved


how many of the entries are positive?
Given x= sin(linspace(0,10*pi,100)), how many of the entries are positive?

6 years ago

Answered
arg min for Optimization problem
norm(X-A.*w-B.*v,-inv);%I assume you want element wise multiplication

6 years ago | 0

Load more