Community Profile

# Bruno Luong

##### Last seen: Today
1,094 total contributions since 2009

View details...

Contributions in
View by

How to solve the equation of binary logic operation, where all unknowns are 0 or 1
[x1,x2,x3,x4,x5,x6]=ndgrid(0:1); x1 = x1(:); x2 = x2(:); x3 = x3(:); x4 = x4(:); x5 = x5(:); x6 = x6(:); b = [x1+x2+x3+...

13 hours ago | 0

Finding the most orthogonal set of n vectors from dataset of unit vectors
I propose this % random test A, which represents 100 normalized vector in R^5 n = 5; m = 100; A = randn(n,m); A = A ./ sqrt...

14 hours ago | 0

EVALIN cannot execute a return?
Yes it is written in the doc. From EVALIN/EVAL document page "evalin(workspace,expression) ... expression — Expression to ev...

1 day ago | 1

| accepted

Matrix compare and unkonw relationships to find
Use regression methods. If you have a linear/affine model, then use linear algebra. If you have "kind" non-linear, use polynomia...

1 day ago | 0

Why is memory reduced for an identical copy of a sparse array?
Nah nothing to do with name length, it's the number of internal non zeros of ('Ir" and "Pr" old notation) array reserved by MATL...

1 day ago | 1

(Block-) Matrix multiplication inaccuracy
Same problem, don't count on exact associativity when working with floating point arithmetics. I can quote word-to-word from wha...

1 day ago | 0

Reshape n-th dimension of an array
You operation makes the array changing its size, you can't use for-loop to store the rotated page in the SAME arrray. And btw f...

1 day ago | 1

| accepted

Curl, Divergence calculation from velocity data
Your data is already gridded, no need to gridded on top of it load('matlab.mat') UU=reshape(data(:,3),[75 62]); VV=reshape(...

1 day ago | 0

Checking a matrix for duplicates in specific row, removing the respective columns
d= [1 2 2 3 4 5 6 6 7; 1 2 3 4 5 6 7 7 8] dd = diff([nan,d(1,:),nan])==0; remove = dd(1:end-1) | dd(2:end) x_cut = uni...

2 days ago | 0

| accepted

Interpolating at vertices of a mesh
In theory you cannot. A function that is piecewise constant on elements is discontinuos at the vertices and you cannot speak ab...

3 days ago | 0

Obtain the mean angle (circle mean of a file)

3 days ago | 0

| accepted

How parentheses effects multiplication with pi ?
From wikipedia "While floating-point addition and multiplication are both commutative (a + b = b + a and a × b = b × a), they a...

4 days ago | 0

| accepted

% Replace this with your image Image100 = peaks(100)+10; %Centering padding in 4 sides PadImage300 = zeros(300,300,size(Ima...

4 days ago | 0

| accepted

How to create a surface with random spheres protruding?
Is this you want? x = linspace(0,1); y = linspace(0,1); [X,Y] = meshgrid(x,y); Z = zeros(size(X)); N = 30; for k=1:N ...

4 days ago | 0

| accepted

Integral calculation using matlab
Feel free to change these hyper-parameters n = 3 k = 2*pi*rand() integral(@(phi) arrayfun(@(phi) abs(integral(@(theta) exp(...

4 days ago | 0

| accepted

Combining function handles into one function handle
a = @(x) x(1)^2+x(2)^2; b = @(x) x(3)^2-x(4)^2; c = @(x) x(1)*x(4); % suppose your for-loop puts each function handle in a ...

4 days ago | 0

I cannot find the distance between two matrices with respect to the Frobenius inner product.
Distance in frobenius scalar product: dist_AB = norm(A - B, 'fro') which is the same as this norm(A(:)-B(:),2)

4 days ago | 0

| accepted

Indexing problem with matrices
A = [3 5 9 6 ; 2 1 13 6 ; 6 8 52 4 ; 13 6 8 22 ]; GRID = [linspace(1,100,100); rand(1,100); rand(1,100)]' Code [tf,loc]=ismem...

4 days ago | 0

| accepted

Convolution of to matrices
Example t1 = 0:2; A1 = [0.25 0.5 0.25]; t2 = [0 3 6]; A2 = [0.25 0.5 0.25]; Code for convolution vector Y (t,A) (I don't kn...

4 days ago | 0

| accepted

How do I turn of thr grid of a surface but keep the edge line on?
Just serve yourself with plot3 commands [X,Y,Z] = peaks; surf(X,Y,Z,'edgecolor','none'); hold on plot3(X(1,:),Y(1,:),Z(1,:),...

4 days ago | 1

Select points inside a polygon

5 days ago | 1

| accepted

Select points inside a polygon
But you already have the index in your code. here ... inon = in | on; % Combine .i...

5 days ago | 1

How to make a matrix of zeros and ones with a specific distance between each one?
dmin1=3; n=10; A=zeros(n); A(1:dmin1:end,1:dmin1:end)=1; disp(A)

5 days ago | 0

| accepted

Extend a 20x1 structure to be a 20x10 structure
repmat(s,1,10);

5 days ago | 0

| accepted

Algorithm to extract linearly dependent columns in a matrix
Test matrix (10 x 6) with rank 4 M = rand(10,4)*rand(4,6) Automatic selection of independent columns of M [Q,R,p] = qr(M,'vec...

5 days ago | 2

Section an array into equal rows and changing simultaneously the values of each section.
Initial data >> M=randi(10,3,4) M = 1 3 9 4 6 10 3 4 8 8 5 6 ...

5 days ago | 0

Call vector by key
Work for me >> M=containers.Map('KeyType','double','valueType','any') M = Map with properties: Count: 0 ...

5 days ago | 0

| accepted

How I can find the index when both signals are high?
Assuming your signal are binary vectors of the same size b and r both = min(b,r); d = diff([0; both(:); 0]); upidx = find(d=...

5 days ago | 1

| accepted

Polyfit with other model
Generate test data x=linspace(0,1,100) P = [rand(1,3) 1] y=polyval(P,x) + 0.1*randn(size(x)); Fit polynomial (order n) y=P(x...

5 days ago | 0