Community Profile

photo

Bruno Luong


717 total contributions since 2009

Bruno Luong's Badges

  • Revival Level 1
  • Thankful Level 2
  • Guiding Light
  • 6 Month Streak
  • Knowledgeable Level 4
  • First Answer
  • Speed Demon
  • Solver

View details...

Contributions in
View by

Answered
How does the "boundary" function decide which points to include in its calculation?
You can look at tthe code to see what it does edit boundary.m The relevant part is Acrit = shp.criticalAlpha('one-region'); ...

2 days ago | 0

Answered
Curve Fitting, Periodic Function
You might be interested in my free knot spline tool that can handle periodic function.

2 days ago | 0

Answered
computing Variance between vectors
No you are not right, the variance computes the square of the "dispersion" of the random variable. In case of random vector vari...

3 days ago | 1

Answered
64 bit binary number representation in matlab without rounding off
Assuming you have your binary in string of length 64 such as b=repmat('0',1,64); b([1 end])='1', You can convert to uint64 in...

4 days ago | 1

Answered
how to replace the elements row by rows instead of column by column in matrix
f = @(A)cumsum(A==3,2)>0; A = A + f(A).*fliplr(f(fliplr(A)))

4 days ago | 2

Answered
Find first non-NaN in each column of array & combine into one vector
X = [2 NaN NaN NaN; 4 6 NaN NaN; NaN NaN NaN NaN; 5 4 7 8 ] [m,n] = size(X); [I,J] = ndgr...

4 days ago | 1

| accepted

Answered
How to solve a special linear equation Ax=b? A is a row vector.
Code for p = Inf and noise_threshold = 0.01; A = [0.103+0.201i 0.196+0.294i 0.401+0.499i 0.602+6.993i 0.803+0.892i] b = 0.5+0....

5 days ago | 0

Answered
Finding unique set from large dataset
x = ["abc", "bcd", "ded"] % no need using curly bracket for strings string(unique(cat(2,x{:}))')'

6 days ago | 0

Answered
Full change of array?
You make a mixing array/scalar in your code. Change count(count+1) = count + 1; to count = count + 1;

6 days ago | 0

| accepted

Answered
Find equal rows between cell array and matrix into for loop
Try this: A=[-0.11 7.17 3.66 -0.09 3.45 1.55 -0.21 2.17 9.87 -0.14 4.88 6.66] B{1,1} = [-0.09 3.45 1.55] B{1,2...

6 days ago | 0

| accepted

Answered
How to save a 3D surface plot in 2D view in vector image format?
Try this h=surfc(peaks,'LineStyle','none'); set(h(2),'LineColor','k'); view(2); % Make contour-plot on top of the surface ...

6 days ago | 0

Answered
How to plot a struct with 2 fields in Matlab
Try this x=reshape([T(:).x],size(T)); y=reshape([T(:).y],size(T)); plot(x(:,[1:end 1])',y(:,[1:end 1])')

6 days ago | 0

| accepted

Answered
Problem with data indexing in nested structure
n = length(Z.hours); % 3 sg=zeros(n,2); for i=1:n b = strcmp({Z.hours(i).AA(:).source},'sg'); sg(i,:) = [i,Z.hours(i...

7 days ago | 0

Answered
How to unload C++ interface (of shared library)
Not sure if it's applicable for C++ but have you checked doc unloadlibrary

7 days ago | 0

Answered
Check points inside n number of triangle in a square
see pointLocation method of Triangulation class

7 days ago | 0

Answered
Mix-integer optimization problem using GA
Take x1 fix allowed value, e.g. 32, optimize wrt (x2,...), repeat 4 times pick the solutions (among 4) with smallest score value...

7 days ago | 0

Answered
I want to double all the points on the elliptic curves in matlab
See this post there a an algo to demonstrate doubling and adding points in EC. Adapt for your case % EL parameters a = 0; b ...

7 days ago | 0

| accepted

Answered
How can I get the index numbers of cells that form a specific string?
s='a.b.c.d.e' str=[{'a.b.c.d'};{'b.c.d.e'};{'a'};{'b'};{'c'};{'d'};{'e'}] c = idexing(str, s); c{:} str=[{'a.b'};{'b.c'}...

7 days ago | 1

Answered
Assign Value to Multiply Indexed Range
You might store in a table, which by design put the two variables/row dimensions to the same level; so you can index them either...

7 days ago | 0

| accepted

Answered
How to get the vertex points of all grid points within a cube?
[x,y,z]=ndgrid(0:5); scatter3(x(:),y(:),z(:),'r')

7 days ago | 1

Answered
Finding the Probability of a Sequence of Numbers
N = histcounts2(A(1:end-1),A(2:end),1:121,1:121); p = N / sum(N(:))

7 days ago | 0

Answered
How to speedup assignment of indexed large matrix?
In general on a computer there is a huge different between accessing contiguous memory block (fast, the later code) and non cont...

8 days ago | 0

| accepted

Answered
How can I create a matrix with combination of some other matrix elemenst dynamicaly in a loop
V = {[1 2 3] [4 5] [6 7 8] [9 10]}; M = zeros(1,0); n = cell(0); for k=1:length(V) Vk = V{k}; % replace by your dynami...

8 days ago | 0

| accepted

Answered
How to extract only numerical values from cell into new column array?
s={"chb12_06.edf" "1665 seconds" "1726 seconds" "3415 seconds" "3447 seconds" "chb12_08.edf" "1426 seconds" "1439 seconds" "1591...

8 days ago | 0

| accepted

Answered
How do I find the centre of gravity for an irregular shape?
You can get the coordinates of the centroid if you have a boundary coordinates of a polygonal region: [xc,yc] = polygoncentroid...

9 days ago | 0

| accepted

Answered
Replace elements of a matrix by a smaller matrix which contains circular shaped values margins
C = A; sB = size(B); idx = {1+(1:sB(1)),1+(1:sB(2))}; % adjust offset 1 and 1 if B to be moved at other place C(idx{:}) = B ...

9 days ago | 0

| accepted

Answered
How to compute a Hankel matrix for N-dimension ?
Not sure what is the Hankel in 4-D but by extension in 2D it should be something like this w=5; x=4; y=3; z=2; b = rand(1,w...

9 days ago | 0

| accepted

Answered
How to fit ellipse equation through segment of ellipse?
Warning: you won't ever get reilable ellipse with such as small portion of data. I'll still provide you a code (Optimization ...

9 days ago | 2

Answered
How to gracefully truncate a matrix of unknown dimensions?
Input = rand(3,4,5) Dimension = 2; a=2; b=4; commaidx = cell(size(size(Input))); commaidx(:) = {':'}; commaidx{Dimension}...

11 days ago | 0

Answered
Find constraints on polynomial coefficients optimization
Why can't you implement ts := max(min(-a2/(2*a1),T),0); Then add the 6 constraints into your minimization pb: two non-linear ...

12 days ago | 0

| accepted

Load more