Answered
How can you include indices in a function of a discrete process?
r([1,10])=[.035, 0]; kappa=.3; theta=.03; sigma=.1; deltat=1; for j1=2:10 r(j1)=r(j1-1)+kappa*(theta-r(j1-1))*deltat...

14 years ago | 0

Solved


Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

14 years ago

Solved


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

14 years ago

Solved


Find perfect placement of non-rotating dominoes (easier)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

14 years ago

Solved


Tic Tac Toe FTW
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...

14 years ago

Solved


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

14 years ago

Answered
Count how many times a number appears in a matrix and assign that increasing value to a new matrix
out = ones(size(X)); for j1 = 1:size(X,2) [u,i1] = unique(X(:,j1)); id = i1(histc(X(:,j1),u) > 1); out...

14 years ago | 1

| accepted

Solved


Sums with Excluded Digits
Add all the integers from 1 to n in which the digit m does not appear. m will always be a single digit integer from 0 to 9. no...

14 years ago

Solved


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

14 years ago

Solved


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

14 years ago

Solved


Scrabble Scores
Given a word, determine its score in <http://en.wikipedia.org/wiki/Scrabble Scrabble>. The input string will always be provide...

14 years ago

Solved


Encode Roman Numerals
Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

14 years ago

Solved


Find the peak 3n+1 sequence value
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

14 years ago

Answered
can someone tell me whats wrong with my coding?
x =size(a,1); d=inf; for n=1:x k = a([1:n-1,n+1:end],:); c=det(k*k.') if c < d; d = c;...

14 years ago | 0

Answered
Is there unknown error in strcmp?
D={[28];[28];[28];[0];[0]}; strcmp('[28]',['[',num2str(D{2}),']']) or isequal({28},D(2)) or 28 == D{2} ...

14 years ago | 0

| accepted

Answered
calculating the neighbour values
A = [ 542 605 341 615 928 471 550 839 1185 315...

14 years ago | 0

| accepted

Answered
Trying to Average Data sets
[ii ii] = ndgrid(ones(50,1),(1:1500)'); [i1 i2] = ndgrid(ii(:),1:N); out = accumarray([i1(:) i2(:)],yourmatrix(:),[],@me...

14 years ago | 0

Answered
How I can vectorize the next code?
M = randi([100,300],10); v = randi(10,7,1); w = randi(10,7,1); M(v + size(M,1)*(w-1)) = 1

14 years ago | 0

Answered
regular expressions resources and regular expression problem
1. Read <http://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html here> about the |Regular Expressions| 2. ...

14 years ago | 0

| accepted

Answered
How do you convert an array into a square matrix?
M = ones(numel(x),1)*x; M = bsxfun(@plus,x,zeros(numel(x),1));

14 years ago | 0

Answered
Help with the equation in making groups.
min1 = 2; max1 = 3; s = 43; ns = fullfact(floor(s./[min1 max1])); out = ns(find(ns*[min1 max1]' == s); OR w...

14 years ago | 0

Answered
vector matrix multiplication with increment
out = A.*(W + A)

14 years ago | 0

Answered
solving exponential equation from a matrix values
A=[1 2 3 4 5]; out = 1./(1+exp(-A))

14 years ago | 0

| accepted

Answered
Efficiency of a symbolic math loop
P1 = [1,-1,0.1]; P2 = [2,3,0.1]; P3 = [-5,6,0.2]; %3 points define a plane cameraPosition = [0 0 0.5]; pixel = [1...

14 years ago | 0

| accepted

Answered
Removing Zeros from the Beginning of a Matrix
B = A(cumsum(A,2) > 0)

14 years ago | 2

| accepted

Answered
How can I solve a system of equations symbolically?
syms a m L1 L2 L3; A = [1 2*m 0; a 3*m 1; 1 1 a]; b = [L1; L2; L3]; x = A\b

14 years ago | 0

| accepted

Answered
How can I create a linspace vector using date commands
out = datestr(now:now+number_day-1)

14 years ago | 0

Solved


Counting in Finnish
Sort a vector of single digit whole numbers alphabetically by their name, in Finnish. See the Wikipedia page for <http://en.wik...

14 years ago

Solved


Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So...

14 years ago

Load more