답변 있음
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년 전 | 0

| 수락됨

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

대략 14년 전 | 0

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

대략 14년 전 | 0

| 수락됨

답변 있음
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년 전 | 0

답변 있음
combine Input with formula
try use s2=eval(vectorize(Y2));

대략 14년 전 | 0

| 수락됨

문제를 풀었습니다


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년 전

답변 있음
how can i define an array with different increments?
diff(t) ADD dist(t)

대략 14년 전 | 0

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 1

| 수락됨

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 1

문제를 풀었습니다


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년 전

문제를 풀었습니다


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

대략 14년 전

답변 있음
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년 전 | 1

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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

대략 14년 전

답변 있음
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년 전 | 0

| 수락됨

문제를 풀었습니다


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년 전

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

대략 14년 전 | 0

| 수락됨

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

대략 14년 전 | 0

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

대략 14년 전 | 0

| 수락됨

답변 있음
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년 전 | 0

| 수락됨

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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년 전

문제를 풀었습니다


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

대략 14년 전

더 보기