Respondida
what is the best fit for a set of data?
>> T = readtable('Path\to\your\file\dynamic viscosity.xls'); >> x = T.Temperature; >> y = T.DynamicViscosity; >> ft = fittype...

alrededor de 7 años hace | 0

Respondida
Copying values between two index number
P = [651 1338 1997 2679 3394 4222 4879 5619 6313 7047 7624 8408 1 1 1 1 1 1 1 1 1 1 1 1 0 1.34 1.28 1.33 1.39 1.61 1.28 1.44 1...

alrededor de 7 años hace | 0

Respondida
order 20 highest values of a pagerank vector
[M,position] = maxk(x,20);

alrededor de 7 años hace | 0

Respondida
How to extract value from cell, then from matrix?
B = cat(3,p{:}); p0_3 = num2cell(squeeze(B(end,:,:)).',1);

alrededor de 7 años hace | 1

| aceptada

Respondida
Sequences for a 3D matrix
k = reshape([1,1,0],1,1,[]); result = sum(convn(A,k,'same')==2,3);

alrededor de 7 años hace | 0

Respondida
How can I make a column appending columns which are of size of sum of other column?
J = cumsum(CG); ii = zeros(J(end),1); ii(J-CG+1) = 1; out = lat(cumsum(ii));

alrededor de 7 años hace | 0

Respondida
How can I number each element of a matrix according to the corresponding ordered position, row by row?
[~,ii] = sort(A,2); [~,out] = sort(ii,2)

alrededor de 7 años hace | 1

| aceptada

Respondida
How to make a symmetric matrix
... make a symmetric matrix: M = tril(randi([0 9],6),-1); B = M + M' + eye(6); Maybe use function toeplitz: B = toeplitz(ran...

alrededor de 7 años hace | 4

| aceptada

Respondida
how to average column 3 when column 1 and column 2 satisfies some condition in matrix
T = readtable('file1.txt'); or M = [1 2 22 1 2 12 1 3 0 1 3 4 2 2 6 2 2 0 2 3...

alrededor de 7 años hace | 1

| aceptada

Respondida
selecting and extracting contiguous points as one event
let a - your data - vector. out = sum(diff([0;a(:) > .13]) == 1);

alrededor de 7 años hace | 0

| aceptada

Respondida
Reshaping an array of n rows in a custom way
a = [... 1.0000 4.5000 1.0000 5.0000 1.0000 6.4000 1.0000 0.6700 2.0000 7.0000 2.00...

alrededor de 7 años hace | 0

Respondida
Matrix value to store as matrix index
ii = (1:5)'; AA = any(ii == permute(A,[3,2,1]),3).*ii;

alrededor de 7 años hace | 1

Respondida
How can i find the average for specific rows
T = readtable('file1.txt'); out = varfun(@mean,T,'g',1);

alrededor de 7 años hace | 0

| aceptada

Respondida
How to compile large matrix
for your case: s = size(data,1); B = [data,ones(s,1)]'; BB = permute(B,[3,1,2]).*permute(B,[1,3,2]); f = B.*(B'*(plane_par.*...

alrededor de 7 años hace | 0

Respondida
How can I find the smallest element in an array without using the function 'min'??
X = [1 2 4 3 0 -1 8 9 -2]; min1 = X(1); idx = 1; for ii = 2:numel(X) if X(ii) < min1 min1 = X(ii); idx...

alrededor de 7 años hace | 2

| aceptada

Respondida
How to find index of non-alternate matrix elements?
A = [1 3 7 9 11 13]; B = [2 4 6 8 10 12 14]; C = {A(:);B(:)}; M = [cell2mat(C),repelem([1;2],cellfun(@(x)numel(x),C))]; S ...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to creating 3 nested for loop to obtain 3d matrix?
y = 10e-3; x = 10e-3; z = 2e-3:0.1e-3:3e-3; alpha = 1:0.1:3; beta = 1:0.1:3; [zz,alp,bet] = ndgrid(z,alpha,beta); B = zz...

alrededor de 7 años hace | 3

| aceptada

Respondida
how to order a matrix?
EDIT >> B = [-3380.5 1 -1 1 -6760.7 0 -1 0 -3380....

alrededor de 7 años hace | 1

| aceptada

Respondida
Remove same element from vector
a = sort(unique(E,'rows'),2); b = unique(a(:)); c = hist(a(:),b); out = a(all(ismember(a,b(c > 1)),2),:);

alrededor de 7 años hace | 0

| aceptada

Respondida
Yearly average from monthly data
s = size(A); B = squeeze(mean(reshape(A,[s(1:2),12,s(3)/12]),3));

alrededor de 7 años hace | 2

| aceptada

Respondida
I need to separate values in the column D, for same values of in the column A, B and for different values in the column C. How to do that ?
[D,t] = xlsread('Copy of data.xlsx'); [~,~,C] = unique(t); t = string(t(:)) + cell2mat(accumarray(C,1,[],@(x){(1:numel(x))'}))...

alrededor de 7 años hace | 0

Respondida
Help using the arrayfun() function to apply strsplit() to all entries in a string array
In R2016b: >> weather_strings = string({'UTC,2140991,49.0' 'UTC,2140992,49.1' ...

alrededor de 7 años hace | 0

Respondida
How to get row index based on two columns
C = {12 'Continuous' 891 72 'Continuous' 23 82 'Continuous' 562 222 'Break' 25 132 'Continuous' ...

alrededor de 7 años hace | 2

| aceptada

Respondida
Using logically indexed vector in a loop to create another vector
a = 5; b = 9; c = 1; p = (-3:3)'; k = 2; out = psifun(a,b,c,k,p); here psifun - function: function out = psifun(a,b,c,k...

alrededor de 7 años hace | 1

Respondida
Change the format of an excel spreadsheet using matlab
[data,c] = xlsread('for_Alex.xlsx',2); out = for_alex(data,c,53,[5,33]); here for_alex - function: function out = for_alex(da...

alrededor de 7 años hace | 0

Respondida
Split array into some equal and some unequal length sections
n = 60; ii = (1:numel(a))'; out = accumarray([rem(ii-1,n)+1,ceil(ii/n)],a,[],[],nan); or out = reshape([a;nan(mod(-numel(a...

alrededor de 7 años hace | 0

| aceptada

Respondida
Problem with for loop
s = size(A,2); [ii,jj] = find(cumsum(cat(3,A > 5,A < 200)) == 1); out = accumarray([rem(jj-1,s)+1,ceil(jj/s)],ii,[s,2],[],nan)...

alrededor de 7 años hace | 0

| aceptada

Respondida
MxM correlation Matrix output
toeplitz(vec)

alrededor de 7 años hace | 0

| aceptada

Respondida
Taking each column and element wise multiply to a matrix
out = bsxfun(@times,reshape(A,size(A,1),1,[]),B);

alrededor de 7 años hace | 0

Respondida
convert to 2d to 3d
Let A - your image with size [3400 x 2400], size of small image -> [340 x 40]. p = 340; n = 40; [q,w] = size(A); out =...

alrededor de 7 años hace | 0

Cargar más