Answered
Do you help me create a matrix?
out = repelem(DNdog,3) ; or out = kron(DNdog,[1;1;1]);

9 years ago | 0

| accepted

Answered
How do I calculate the mean value for the days in a big data set?
T = table2timetable(readtable('Test.Dataset.xls','ReadVariableNames',false)); out = retime(T,'daily','mean'); or for MAT...

9 years ago | 1

Answered
How can I convert a date and time vector of components (datevec) back to datenum?
Your_datevec = [2017 5 3 13 20 45; 2017 5 20 20 14 47]; Your_datenum = datenum(Your_datevec);

9 years ago | 0

Answered
Could anyone please help me to code this problem.
M1 = flipud(M(:)); out = cell2mat(arrayfun(@(x)M1(1:x),maxtop(:),'un',0)); or M1 = flipud(M); m = numel(M1); ...

9 years ago | 0

Answered
How to use cellfun in only cells with numbers or how to create a csv file with different elements (numbers and strings)?
l0 = cellfun(@ischar,cellArray); cellArray(l0) = num2cell(str2double(cellArray(l0))); or l0 = cellfun(@isnumeri...

9 years ago | 1

Answered
Manipulate multidimensional matrix in for loop
a = num2cell(multidim,[1,2]); matrix = cat(1,a{:});

9 years ago | 0

| accepted

Answered
extracting an element in a vector
[~,ii] = max(A); [~,ii(2)] = min(A); out = A(setdiff(1:numel(A),ii)); other way [~,ii] = sort(A); out = A...

9 years ago | 2

| accepted

Answered
Sum of certain value in a matrix
out = sum(A(:))

9 years ago | 0

| accepted

Answered
Using for loop to calculate percentiles over a time series
DIS_1_1_belowQ90 = sum(DIS < prctile(DIS,90,3),3)/size(DIS,3)*100; % R2016b and later DIS_1_1_belowQ90 = ... sum(...

9 years ago | 0

| accepted

Answered
Extracting data from a matrix
a = [0 25 15; 0 0 25; 16 13 12]; out = a(sum(a == 0,2) < 2,:)

9 years ago | 0

| accepted

Answered
Turn a row vector with -99 separating data sets into a matrix
out = zeros(size(experdata)); l0 = experdata == -99; ii = find(l0)+1; out([1,ii]) = 1; out = cumsum(out(~l0)); ...

9 years ago | 0

Answered
How to calculate the daily average from a txt file?
T = readtable('Wind_data.txt'); x = num2cell(T{:,1:5},1); Time = datetime(x{:},0); tt = [timetable(Time),T(:,6:end)];...

9 years ago | 0

Answered
how to match complete row in cell array and then find index
C - your cell-array R = C(4,:); out = find(all(ismember(cellfun(@num2str,C,'un',0),cellfun(@num2str,R,'un',0)),2));

9 years ago | 0

Answered
What is the best way to vectorize this matrix problem?
B = accumarray([D(:),repelem((1:size(D,2))',size(D,1))],A(:));

9 years ago | 1

Answered
how to group data points in matrix
out = [A,discretize(A,0:5:max(A)+1,'IncludedEdge','right')];

9 years ago | 0

Answered
How can I replace NaN elements with the nearest value in the same column?
*FIXED 2* m = flipud(M) t = ~isnan(m); ii = cumsum(t); ii(ii == 0) = 1; ii = bsxfun(@plus,[0,ii(end,1:end-1)]...

9 years ago | 1

| accepted

Answered
Find values in array a based on unique values in array b as well as based on the range of values in b
out = accumarray(cumsum([true;diff(b(:))] ~= 0),a(:),[],@(x){unique([x(1),x(end)])})

9 years ago | 0

Answered
Map array values relative to another array
aa = sort(a); bb = sort(b); F = {griddedInterpolant(aa(:,1),bb(:,1)),griddedInterpolant(aa(:,2),bb(:,2))}; out = cell...

9 years ago | 0

Answered
location of element in matrix
[l0,ii] = ismembertol(mat(:),x); [i0,j0] = ind2sub(size(mat),find(l0)); [~,i1] = sort(ii(l0)); out = [i0,j0]; out ...

9 years ago | 1

| accepted

Answered
Replacing each array element with a series of values
T_new = reshape(T(:)' + (0:2)',1,[])

9 years ago | 1

Answered
Read .csv locate Pt Name, X, Y, Z and export to .txt
T = readtable('MATLAB_Query.csv'); Tout = T(ismember(T.Section,'FLIP'),T.Properties.VariableNames(1:6)) writetable(Tout,...

9 years ago | 2

Answered
Interpolation for 3D scattered data
a= [0 5 9 20 30 35] ; % cordinbates X b= [0 4 10 27 31 35] ; % cordinbates Y I'm fixed c= [1 5 6 8 10 20 ] ; % cor...

9 years ago | 0

Answered
generate a list of n numbers that are uniformly distributed between a and b?
a = 200; b = 1500; n = 20 ; out = randi([a,b],n,1) or D = round(linspace(a,b,n)) out = D(randperm(n)...

9 years ago | 0

Answered
For loop not working when run inside a function!
If we have two matrices of size: B (400x30) C (1x30): A = B.*C; % in R2016b and later A = bsxfun(@time...

9 years ago | 0

Answered
How to insert text in a matrix - If function
|D| is |Divident| |F| is |Forecasted_DPS| A = {'good news','bad news','no news'}; ii = (D >= 1.03*F) + (D <= .97*F)*2...

9 years ago | 0

Answered
Return values for specific set of indices
out = N(sub2ind(size(N),dx, dy));

9 years ago | 1

| accepted

Answered
Finding Angle between two points w.r.t x-axis
*_EDIT_* |A| - your matrix (19 x 2) out0 = atand(A(:,2)./A(:,1)); out = A(out0 < 10,:);

9 years ago | 1

Answered
Find correlation coefficient of every nth row
UVI_am = reshape(CP_ALL_W_am(:,8),11,[]); UVI_pm = reshape(CP_ALL_W_pm(:,8),11,[]); R = arrayfun(@(ii)corr(UVI_am(:,...

9 years ago | 0

| accepted

Load more