Answered
mulptiply each column of a cell matrix by 4 when it contains strings and NaN
t = ~cellfun(@ischar,Aq); Aq(t) = cellfun(@(x)x*8,Aq(t),'un',0);

14 years ago | 0

| accepted

Answered
Incrementing value in an executing loop
G=5; th = 0; while sum(A(:) >= th) >= G th = th + 1; end

14 years ago | 0

Answered
multiply each column of a cell matrix that contains NaN by 8
cellfun(@num2str,num2cell(str2double(A)*8),'un',0)

14 years ago | 0

| accepted

Answered
how to plot date(the format of the date is cell)
yourprice=randi(25,10,1); yourpricedate = {'2012/3/27' '2012/3/28' '2012/3/29'... '2012/3/30' '2012/4/5' '2012/4/6' '20...

14 years ago | 0

Answered
combine Input with formula
try use s2=eval(vectorize(Y2));

14 years ago | 0

| accepted

Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

14 years ago

Answered
how can i define an array with different increments?
diff(t) ADD dist(t)

14 years ago | 0

Answered
Copy pixels from one Matrix to other matrix
EDIT (block with size 64x64) rgbImage = imread('861.jpg'); bs=64; ca = mat2cell(rgbImage,bs*ones(1,size(rgbImage,1)/...

14 years ago | 0

| accepted

Answered
How can I create a matrix where every combination of numbers between 0 and 1 (step x) is used and every row sums to one?
for step stp = .5 stp = .5; ii = cell(1,6); [ii{:}] = ndgrid(0:stp:1); out = cell2mat(cellfun(@(x)x(:),ii(:,end:-1...

14 years ago | 1

| accepted

Answered
changing the string "JF 2009" to two seperate strings "J 2009" " F2009" (reposted)
Amodified = []; for jj = 1:size(A,1) if ~strcmp(A{jj,3},' ') z = [A([jj,jj],1:2),... [{[A{...

14 years ago | 0

| accepted

Answered
Selecting randomly from matrix
adjacent values B(randi(size(B,1)-1)+(0:1),randi(size(B,2)-1)+(0:1)); not adjacent values ii = randperm(size(B,1));...

14 years ago | 1

Solved


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

14 years ago

Solved


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

14 years ago

Answered
How do I vectorize the loop for the local linear regression?
xc = bsxfun(@minus,x',x); w = exp(-.5*(xc/h).^2)/sqrt(2*pi*h^2); xw = xc.*w; s0 = mean(w); s1 = mean(xw); s2 = ...

14 years ago | 1

Solved


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

14 years ago

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

14 years ago

Solved


Permute diagonal and antidiagonal
Permute diagonal and antidiagonal For example [1 2 3;4 5 6;7 8 9] -> [3 2 1;4 5 6;9 8 7] WITHOUT diag function (and variable n...

14 years ago

Solved


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

14 years ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

14 years ago

Answered
Kurtosis ignoring 0s in matrix
out = cellfun(@(x)kurtosis(x(x~=0)),num2cell(A,1)); or s = sum(A~=0); x1 = bsxfun(@minus,A,sum(A)./s); x1(A == 0...

14 years ago | 0

| accepted

Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

14 years ago

Answered
Manipulating matrix in particular columns
final_result = { 'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&T6' 'YAR029W' 'dd' 'uu' 'dd...

14 years ago | 0

| accepted

Answered
Merging the unique values
EDIT final_result = {... 'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&T6' 'YAR029W' 'dd' 'u...

14 years ago | 0

Answered
Error:Conversion to cell from logical is not possible.
r = { 'yaddata' 'c1' 'c2' 'c3' 'c4' 'c5' 'yar12' 'hi' 'hello' 'hi' 'hello' 'hi'...

14 years ago | 0

| accepted

Answered
Error in Interp1 function when searching for a corresponding matrix
Let |A| - cell array your matrices. A = arrayfun(@(ii)randi(10,5),1:8,'un',0); Da = cellfun(@(x)x(:),A,'un',0); ...

14 years ago | 0

| accepted

Solved


Get the area codes from a list of phone numbers
Given a string of text with phone numbers in it, return a unique'd cell array of strings that are the area codes. s = '508-647...

14 years ago

Solved


Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...

14 years ago

Solved


Connect Four Win Checker
<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

14 years ago

Solved


DNA N-Gram Distribution
Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

14 years ago

Solved


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

14 years ago

Load more