답변 있음
How to select non zero elements of matrix/array and return a 2d array of values and index positions
[r,c,v] = find(a); out = [v,r,c];

대략 11년 전 | 0

| 수락됨

답변 있음
I want to calcualate this without for loop
try use variant with |Image Processing Toolbox| image1= imresize(o_image, [256, 256]); b_image = imfilter(image1...

대략 11년 전 | 1

| 수락됨

답변 있음
Search multiple matrices for values at common index positions
a.*d.*e > 0;

대략 11년 전 | 2

답변 있음
How to get the starting and ending index of repeated numbers in an array?
A=[2 2 1 2 3 2 2 2 2 2 3 5 6 7 7 7 7 6 5]; ii = [0, diff(A(:)')==0,0]; i1 = strfind(ii,[0 1]); i2 = strfind(ii,[1 0])...

대략 11년 전 | 0

답변 있음
different answers for implementing summation
J = sum(f1-a*exp(-(x1-mu).^2/sigma)).^2) for 2 variant: f1=[10 20 30 40 50] x1=[1 2 3 4 5] J1=0 J=@(f...

대략 11년 전 | 0

답변 있음
Identify which row has a number which exceeds a number N
any([A > N, A == 0 , ~diff(sort(A,2),[],2)],2)

대략 11년 전 | 0

답변 있음
how can I add zeros elements to a matrix?
a= [1 2 3; 1 2 3; 1 2 3] b = a b(5,5) = 0

대략 11년 전 | 8

답변 있음
converting cell array to matrix
a = {'a' , 'b' , 'c' ,'d' , 'e'}; a = sprintf('%c,',[a{:}]); a = a(1:end-1);

대략 11년 전 | 1

| 수락됨

답변 있음
converting a double array to a logical array conditionally
A = [2 1 6 7 3 5 4]; B = ismember(sort(A),A(1:3));

대략 11년 전 | 0

| 수락됨

답변 있음
Sorting elements in a matrix via first column characterization
B = sortrows(A,1); or [~,ii] = sort(A(:,1)); B = A(ii,:);

대략 11년 전 | 0

답변 있음
I want to normalize a vector in range -5 to +5. Is it possible?
As wrote Guillaume: variant 1: out = A - 5; % if A >= 0 & A<=10 variant 2: m = min(A(:)); out = (A(:)-m...

대략 11년 전 | 0

답변 있음
How do I interpolate usng vectors? and they are large..
F = scatteredInterpolant([depth,lon],temperature); use l1 = linspace(min(depth),max(depth),1000); l2 = linspace...

대략 11년 전 | 0

| 수락됨

답변 있음
Calling text file in matlab
ii = [1 2 1 3 1 1 2 3 1]; s = [0.3 0.4 0.6 0.1 0.5 0.7 0.2 0.11 0.9]; [x,y,z] = size(s); ij = ...

대략 11년 전 | 1

| 수락됨

답변 있음
help for matrix manipulation with loop
n= 3; out = [zeros(n);eye(n)]; with loop out = zeros(2*n,n); for jj = 1:n out(jj+3,jj) = 1; en...

대략 11년 전 | 0

답변 있음
repalacement of string with phone numbers
function out = funbyMuhammad(in_char) abc = ['()+-_',setdiff('A':'Z','QZ')]; d = ['#*','0':'9',' ']; if a...

대략 11년 전 | 1

| 수락됨

답변 있음
Sum of cross diagonals of a non symmetric matrix
sum(spdiags(A(end:-1:1,:)))

대략 11년 전 | 0

답변 있음
how to average the minutes data to hourly data if the data is missing for some minutes(samples) in between
n = xlsread('Book1.xlsx'); n(:,1) = n(:,1) + datenum('30.12.1899','dd.mm.yyyy'); [Y,M,D,H] = datevec (n(:,1)); [c0,~,...

대략 11년 전 | 1

| 수락됨

답변 있음
How to shift just the outer loop in an array?
A = [1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20], mover = 2 [m,n] = size(A); i0 = [(1:m)';(2:n)'*m;m*n - ...

대략 11년 전 | 0

답변 있음
Concatenate Columns of Cells
d = { '01/04/2004' [ 0] [ 0] [ 0] [ 0] '01/04/2004' [ 0] [...

대략 11년 전 | 0

답변 있음
How can I set specific Elements of a Matrix to zero without a for loop
o= ones(3,3); ii = [1 2 2]; [m,n] = size(o); o(sub2ind([m,n],(1:m)',ii(:)')) = 0; other way n = 3; ou...

대략 11년 전 | 0

| 수락됨

답변 있음
Grouping elements in an array?
x = struct2cell(data); out = cellfun(@(y)nanmean(reshape([y,nan(1,mod(-numel(y,7))],7,... ...

대략 11년 전 | 0

| 수락됨

답변 있음
How do you maintain value order when removing zeros from a matrix?
SP_Marker_C(~cellfun('ischar',SP_Marker_C)) = {[]}; or SP_Marker_C(cellfun(@(x)x == 0,SP_Marker_C)) = {[]};

대략 11년 전 | 0

답변 있음
Replacing Matrix Cells with Date Values
d = {'01/04/2004' '02/04/2004' '03/04/2004'... '04/04/2004' '05/04/2004' '06/04/2004' '07/04/2004'}; ...

대략 11년 전 | 1

답변 있음
how to make function that return struct vector whose elements are days of month
function out = May2015 [~,k] = weekday(datenum(2015, 5, (1:31)')); out = struct('month','May','date',num2cell((1:31)'),'...

대략 11년 전 | 1

답변 있음
How to index on a loop for first occurrence?
a = [1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 ...

대략 11년 전 | 1

답변 있음
Make matrix from input size
sortrows(fullfact(size(mat)),1)

대략 11년 전 | 1

답변 있음
Searching a cell array of percentile scores based on age and gender
S = table(arrayfun(@(x)sprintf('Y%02d',x),(1:5)','un',0),[19;22;21;nan;19],... [1;1;1;nan;1],{'','58.39','61.2...

대략 11년 전 | 0

| 수락됨

답변 있음
How to make a function that calculate appoximate value of pi
function [pi_here,k1] = a_pi(delta) f = @(k)sqrt(12)* 1./( (2*k+1).*(-3).^k ) ; k1 = ceil(fzero(@(k)abs(f(k))...

대략 11년 전 | 1

| 수락됨

답변 있음
How to symmetrize a matrix
[ny,nx]=size(M); if ny~=nx m = max(ny,nx); M(m,m)=0; end

대략 11년 전 | 0

더 보기