답변 있음
how to make hourly average
h0 = cumsum(ones((datenum(2010, 1, 1)-datenum(2005, 1, 1))*24,1)); d0 = datenum(2005,1,1,h0,0,0); % Let your date d2 = ...

대략 13년 전 | 0

답변 있음
using testtype to check odd or even numbers
if rem(jj,2) == 1 % odd statements elseif rem(jj,2) == 0 % even statements end or if rem(jj,2) ...

대략 13년 전 | 0

| 수락됨

답변 있음
How do I take the average of every n values in a vector?
x = randi(1000,399277,1); n = 1000; m = numel(x); out = nanmean(reshape( [x(:);nan(mod(-m,n),1)],n,[])); or ...

대략 13년 전 | 8

답변 있음
Create a moving average
A - your data L = filter(ones(101,1)/101,1,[A(:) zeros(50,1)]); out = L(51:end);

대략 13년 전 | 1

| 수락됨

답변 있음
if we enter n rows and m colums and gets the output of 2n rows and 2m columns
Please read about MATLAB functions: <http://www.mathworks.com/help/matlab/ref/ones.html |ones|> and <http://www.mathworks.com/h...

대략 13년 전 | 0

| 수락됨

답변 있음
hello i have some doubts about using recursive method about making matrix into sub matrices and should be saved in a single array.
A= reshape(1:24,6,[])'; % your array s = size(A); m = [2 3]; % size of your block t = reshape(A,m(1)...

대략 13년 전 | 0

답변 있음
using greater than or less than in 'switch' and 'case' expressions
use |if...elseif..else..end| if x > 5 disp ('x is greater than 5') elseif x < 5 disp ('x is less than 5')...

대략 13년 전 | 1

| 수락됨

답변 있음
I need to remove every other 9 rows of a matrix
A = randi(100,57,5); % your data a = 19*ones(size(A,1)/19,1); A(bsxfun(@plus,cumsum(a) - a + 1,0:8),:) = [];

대략 13년 전 | 2

답변 있음
How do I copy a 320x240 matrix into a 640x480 matrix and expand everything 200%?
B = kron(A,ones(2));

대략 13년 전 | 1

| 수락됨

답변 있음
Extraction of portion of textfile
f = fopen('nameYourTextFile.txt'); c = textscan(f,'%s','delimiter','\n'); fclose(f); out = c{:}(find(strncmp(c{:},'...

대략 13년 전 | 0

답변 있음
cfit object doesn't work with 'plot' or 'differentiate'
x = (0:.01:4)'; % y = -4 + 8./(1+exp(4.*(x - 2))) + .5*randn(numel(x),1); % your da...

대략 13년 전 | 0

답변 있음
Delete rows with strings for a cell array
A = {'Cause' 'CSSR (%)' 'MO Attempts' 'MT Attempts' 'fghytresdfhjjiiuyt' [ 1] [ ...

대략 13년 전 | 1

| 수락됨

답변 있음
Delete rows with NaN for a cell array
A - your cell array out = A(any(cellfun(@(x)any(~isnan(x)),A),2),:); ADD out = A(all(cellfun(@(x)any(~isnan(x)),A),...

대략 13년 전 | 2

답변 있음
Polyval gives me a error
t1 = feval(g,0.001)

대략 13년 전 | 1

| 수락됨

답변 있음
atan2 of successive point in an Array
out = atan2(A(2:end),A(1:end-1)); or for jj = numel(A)-1:-1:1 out(jj,1) = atan2(A(jj+1),A(jj)); end or ...

대략 13년 전 | 0

답변 있음
How do i reconstruct a matrix???
a - your array a1 = a; n = unique(a(:,1)); for jj = 1:numel(n) if rem(n(jj),2) == 0 t = a1(:,1) == ...

대략 13년 전 | 0

| 수락됨

답변 있음
How to impute missing values using mean for a table
t = ~isnan(a); a1 = a; a1(~t) = 0; s = sum(t); s(s == 0) = 1; out = sum(a1)./s; or as said Iain: o...

대략 13년 전 | 1

답변 있음
Question about vectorizing a search function
[a,b] = ismember(ccoFaceMx(:,1),1:nPoints); [a1,c,c] = unique(b(a)); d = (1:numel(a))'; out = [num2cell(a1), accumarr...

대략 13년 전 | 1

답변 있음
Finding unique rows in a matrix and summing their weights faster
A = [1 2 4 6 1 2 9 2 4 2 6 9]; [aa,cc,cc] = unique(A,'rows'); W = (1:size(A, 1))'; wA = accumarray...

대략 13년 전 | 0

| 수락됨

답변 있음
How to calculate distance from one point base to multipoints and save it as a row?
AP_dist= sqrt(sum(bsxfun(@minus,MS_loc,AP_pos).^2,2)); OR for jj = size(MS_loc,1):-1:1 AP_dist(jj,1) = pdist([M...

대략 13년 전 | 1

| 수락됨

답변 있음
How do i use regular expressions effectively for parsing my text?
try: pattern = '\<red(dy|dish)?\s' ADD pattern = '\<red(d)?(y|ish)?\>'

대략 13년 전 | 0

| 수락됨

답변 있음
how to merge two matrices via one common column
[~,ii] = ismember(A(:,2),B(:,1)); out = [A, B(ii,2)];

대략 13년 전 | 0

| 수락됨

답변 있음
Writing matrix for 2D plane of atoms
a = [-1 2 1]; n = 100; m = numel(a)-1; out = full(spdiags(ones(n,1)*[-1 2 1],-m:m,n,n));

대략 13년 전 | 0

| 수락됨

답변 있음
finding the power of a number
x = 0.6543e+013 x*10^-ceil(log10(x))

대략 13년 전 | 0

답변 있음
Simple question about functions
data1 = practicefcn(); x = data1.x;

대략 13년 전 | 0

| 수락됨

답변 있음
how do I vectorize a loop with multi-dimensional arrays/ outer product
B1 = B(:,:,4); out = reshape(B1(:)*(0:N-1),[size(B1) N]);

대략 13년 전 | 1

| 수락됨

답변 있음
Count the "areas" of zeros and the "areas" of ones in a vector?
a=[0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 1 1 1 0 1 ]; lc = [true;diff(a(:))~=0]; x = a(lc); zerosareas = sum(~x...

대략 13년 전 | 0

| 수락됨

답변 있음
randomly displaying a string from an array
out = X(randi(numel(X)));

대략 13년 전 | 0

| 수락됨

답변 있음
How to find x,y matrix using for sintax
out = a(any(a,2),any(a));

대략 13년 전 | 0

답변 있음
Timestamp Formatting (Datenum Limitation?)
datenum('01/01/13 03:12:45 PM','mm/dd/yy HH:MM:SS PM'); ADD datenum({'01/01/13 03:12:45 PM','01/02/13 06:12:45 AM'},'m...

대략 13년 전 | 0

더 보기