
Bruno Luong
Statistics
All
Content Feed
回答済み
how can I write this in a compact form? can anyone suggest a single line code for it
n = 8; ismember(mod((1:n)-(1:n)',n),[1 n-1])
how can I write this in a compact form? can anyone suggest a single line code for it
n = 8; ismember(mod((1:n)-(1:n)',n),[1 n-1])
5日 前 | 1
回答済み
Hi. How I can write this formula with Matlab code?
n=10; psi=rand(1,n-2); chi = 0; for k=1:n-2 i = nchoosek(1:n-2,k); j = 1:k; l = k+1-j; il = i(:,l); ...
Hi. How I can write this formula with Matlab code?
n=10; psi=rand(1,n-2); chi = 0; for k=1:n-2 i = nchoosek(1:n-2,k); j = 1:k; l = k+1-j; il = i(:,l); ...
7日 前 | 0
回答済み
How to calculate the entropy of a portion of image as in the following formula?
Please try this A=imread('ngc6543a.jpg');; A=double(A(1:500,:,:)); A=sum(A,3); M = 11; N = 11; % Build 8-neighbor [di,...
How to calculate the entropy of a portion of image as in the following formula?
Please try this A=imread('ngc6543a.jpg');; A=double(A(1:500,:,:)); A=sum(A,3); M = 11; N = 11; % Build 8-neighbor [di,...
8日 前 | 0
| 採用済み
回答済み
How to generate random number from Bernoulli distribution?
p = 0.25 X = double(rand(1,1000) < p) histogram(X,'Normalization','pdf')
How to generate random number from Bernoulli distribution?
p = 0.25 X = double(rand(1,1000) < p) histogram(X,'Normalization','pdf')
9日 前 | 0
| 採用済み
回答済み
Interp1 is not woking
Extrapolation is notoriously unstable. So there is no surprise here. v1r = -0.01:0.00001:0 f1r = interp1(v1, f1, v1r, 'spline'...
Interp1 is not woking
Extrapolation is notoriously unstable. So there is no surprise here. v1r = -0.01:0.00001:0 f1r = interp1(v1, f1, v1r, 'spline'...
9日 前 | 0
回答済み
all integer possibilities for equations
@Ravindra Pawar Replace eqt 2 to eqt 1 to remove one variable, you can solve it with gcd or more generally see this oldthread h...
all integer possibilities for equations
@Ravindra Pawar Replace eqt 2 to eqt 1 to remove one variable, you can solve it with gcd or more generally see this oldthread h...
11日 前 | 1
回答済み
how to remove noise from curves and take their derivates
I would chose spline fitting rather than polynomial (bad) or rational. Look at the shape of your data, I doubt any simple analy...
how to remove noise from curves and take their derivates
I would chose spline fitting rather than polynomial (bad) or rational. Look at the shape of your data, I doubt any simple analy...
11日 前 | 0
| 採用済み
回答済み
How to convert matrices of different sizes in a for loop into a single column vector?
... PhaseC = cell(1, nLevels); for k = 1:nLevels ... Phase = acos(subband./amp); PhaseC{k} = Phase(:); end Ph...
How to convert matrices of different sizes in a for loop into a single column vector?
... PhaseC = cell(1, nLevels); for k = 1:nLevels ... Phase = acos(subband./amp); PhaseC{k} = Phase(:); end Ph...
12日 前 | 0
回答済み
How to sort minimum value from a matrix
See matchpairs function number = 6; A = 1+10*(rand(number,2)); B = [4,8; 6,8; 8,8; 6,6.7; 6,5.4; 6,4.1]; % Calculate all dis...
How to sort minimum value from a matrix
See matchpairs function number = 6; A = 1+10*(rand(number,2)); B = [4,8; 6,8; 8,8; 6,6.7; 6,5.4; 6,4.1]; % Calculate all dis...
12日 前 | 1
| 採用済み
回答済み
Faster alternative to polyxpoly
I would add my own BLU_polyxpoly which derived from here https://fr.mathworks.com/matlabcentral/fileexchange/27673-2d-polygon-ed...
Faster alternative to polyxpoly
I would add my own BLU_polyxpoly which derived from here https://fr.mathworks.com/matlabcentral/fileexchange/27673-2d-polygon-ed...
14日 前 | 0
回答済み
Where is the code of a Matlab Object?
which comm.LinearEqualizer If it's mfile contains source code then you can see it.
Where is the code of a Matlab Object?
which comm.LinearEqualizer If it's mfile contains source code then you can see it.
14日 前 | 0
回答済み
How can I find the filter bandwidth of Savitzky-Golay filtering?
sa-golay filter is just non-causal FIR filter, where the coefficients are computed as following order=3;framelength=11; B = sg...
How can I find the filter bandwidth of Savitzky-Golay filtering?
sa-golay filter is just non-causal FIR filter, where the coefficients are computed as following order=3;framelength=11; B = sg...
15日 前 | 1
| 採用済み
回答済み
Multiplication of matrix and first dimension of a 3-D array without for loops
A = rand(4,4); B = rand(4,10,5); % orginal code for i = 1:10 for j = 1:5 C(:,i,j) = A(:,:)*B(:,i,j); end en...
Multiplication of matrix and first dimension of a 3-D array without for loops
A = rand(4,4); B = rand(4,10,5); % orginal code for i = 1:10 for j = 1:5 C(:,i,j) = A(:,:)*B(:,i,j); end en...
15日 前 | 1
回答済み
How to represent [airfoil] coordinates as a polynomial
You could use the free-knot spline xy = [0 0 0.00369000000000000 0.0134500000000000 0.0170200000000000 0.028070000000...
How to represent [airfoil] coordinates as a polynomial
You could use the free-knot spline xy = [0 0 0.00369000000000000 0.0134500000000000 0.0170200000000000 0.028070000000...
15日 前 | 0
回答済み
Set unintentionally triggers uitable callback
I use uistyle to change the background, AFAIK it doesn't trigger callback unlike set()
Set unintentionally triggers uitable callback
I use uistyle to change the background, AFAIK it doesn't trigger callback unlike set()
16日 前 | 0
回答済み
How to create all possible matrices of zeros and ones without having more than one '1' in the same column?
m = 2; n = 3; c = cell(1,n); [c{:}] = ndgrid(1:m); i = reshape(cat(n+1,c{:}),[],n); [j,k] = meshgrid(1:n,1:size(i,1)); X...
How to create all possible matrices of zeros and ones without having more than one '1' in the same column?
m = 2; n = 3; c = cell(1,n); [c{:}] = ndgrid(1:m); i = reshape(cat(n+1,c{:}),[],n); [j,k] = meshgrid(1:n,1:size(i,1)); X...
16日 前 | 1
| 採用済み
回答済み
How to generate code in MATLAB for randomly oriented short fibers?
See if this FEX can help you
How to generate code in MATLAB for randomly oriented short fibers?
See if this FEX can help you
16日 前 | 0
回答済み
How to simplify the for loop for 3D matrix?
load('A.mat'); load('s1.mat'); load('s2.mat'); [m,n,p] = size(s1); % s = [reshape(s1, [m,1,n,p]), reshape(s2, [m,1,n,p]...
How to simplify the for loop for 3D matrix?
load('A.mat'); load('s1.mat'); load('s2.mat'); [m,n,p] = size(s1); % s = [reshape(s1, [m,1,n,p]), reshape(s2, [m,1,n,p]...
16日 前 | 0
| 採用済み
回答済み
is Matlab code a lot faster than Excel formulas?
Impossible to answer with such fuzzy question; the time depends on your hardware, your matlab version, your licences to acess to...
is Matlab code a lot faster than Excel formulas?
Impossible to answer with such fuzzy question; the time depends on your hardware, your matlab version, your licences to acess to...
17日 前 | 1
回答済み
generate two variable from distribution without same result
Warranty never repeated pairs lA = 0; uA = 5; % lower upper bound of A lB = -4; uB = 4; % and B n = 50; % ...
generate two variable from distribution without same result
Warranty never repeated pairs lA = 0; uA = 5; % lower upper bound of A lB = -4; uB = 4; % and B n = 50; % ...
17日 前 | 0
回答済み
How to adjust a curve fit such that it goes through a specific point
Add blue point as additional data point and associate it a strong weight to the rest (see Weights of options)
How to adjust a curve fit such that it goes through a specific point
Add blue point as additional data point and associate it a strong weight to the rest (see Weights of options)
18日 前 | 0
回答済み
Fast way of computing all possible products of n matrices
The more I try my idea, the more Matt's solution seem amazing to me. Here is an algorithm that that build a set of product of a...
Fast way of computing all possible products of n matrices
The more I try my idea, the more Matt's solution seem amazing to me. Here is an algorithm that that build a set of product of a...
18日 前 | 1
回答済み
Why is pause function so inaccurate on Windows?
The reason is that Windows task scheduler resolution is the order of 15 ms in some recent versions. I create some C mex and cal...
Why is pause function so inaccurate on Windows?
The reason is that Windows task scheduler resolution is the order of 15 ms in some recent versions. I create some C mex and cal...
22日 前 | 1
質問
parpool sorting out the default number of workers
I'm a little bit lost in the default number of workers when parpool() is invoked. My PC is standalone with Intel Processor and W...
22日 前 | 1 件の回答 | 0
1
回答回答済み
What is the efficient way to loop though a multidimensional array in matlab?
The inner most loop should be the fist index, the outer most loop last index. Since MATLAB arranges data with first-dimension v...
What is the efficient way to loop though a multidimensional array in matlab?
The inner most loop should be the fist index, the outer most loop last index. Since MATLAB arranges data with first-dimension v...
22日 前 | 2
| 採用済み
質問
parfor unable to classify, why?
Can someone explain why the ind2sub first statement triggers the error, but the second works fine? m = 2; n = 3; mycell = cel...
24日 前 | 1 件の回答 | 0
1
回答回答済み
The proper way to sample 3 normally or lognormal distributed variables added up to 1
This will generate 3 random variables positives and sum to 1, with mean 8/10, 1/10, 1/10: nu=[8 1 1]; B=arrayfun(@(n) ones(1,n...
The proper way to sample 3 normally or lognormal distributed variables added up to 1
This will generate 3 random variables positives and sum to 1, with mean 8/10, 1/10, 1/10: nu=[8 1 1]; B=arrayfun(@(n) ones(1,n...
25日 前 | 0
回答済み
How does matlab get the combinations that meet certain conditions in the matrix
You don't need MATLAB at all. From 2A1 = A2 A1 + A2, We divide by A1, and factor A2 on rhs to get 2 = A2*(1+1/A1) Meaning 2...
How does matlab get the combinations that meet certain conditions in the matrix
You don't need MATLAB at all. From 2A1 = A2 A1 + A2, We divide by A1, and factor A2 on rhs to get 2 = A2*(1+1/A1) Meaning 2...
約2ヶ月 前 | 1
回答済み
How to vectorize this piece of code and why doesn't e come out to be zero though it must come out to be zero because u and b are equal?
Not tested but this for i=1:K for h=1:M ae(h,i)=exp(j*2*pi*(h-1)*d*sind(b(i))); %%%%% ae end for p=1:N ...
How to vectorize this piece of code and why doesn't e come out to be zero though it must come out to be zero because u and b are equal?
Not tested but this for i=1:K for h=1:M ae(h,i)=exp(j*2*pi*(h-1)*d*sind(b(i))); %%%%% ae end for p=1:N ...
約2ヶ月 前 | 0
| 採用済み
回答済み
How to standardize an array so that the maximum value is 1 and minimum is -1 keeping the zero value as zero?
A "smooth" mapping % Data a=randi([-10,10],1,5) pp=pchip([min(a) 0 max(a)], -1:1); normfun=@(a) ppval(pp,a) an=normfun(a)...
How to standardize an array so that the maximum value is 1 and minimum is -1 keeping the zero value as zero?
A "smooth" mapping % Data a=randi([-10,10],1,5) pp=pchip([min(a) 0 max(a)], -1:1); normfun=@(a) ppval(pp,a) an=normfun(a)...
約2ヶ月 前 | 1