Community Profile # Bruno Luong

Last seen: Today Active since 2009

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Shuffle order of cell array without repeating rows
This does not require any special structure of the input (such as number of elements; or groups, or cardinal of groups, or the o...

14 hours ago | 0

Nested for loop - adding elements to a matrix
Try this modification EEG_NofSC = zeros (Nchannels,Nepochs); % move outside the outer loop for iNepochs = 1 : Nepochs ......

22 hours ago | 0

| accepted

Error: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
N=30; % compute the chebyshev differentiation matrix and x-grid Ly =3; eta_ygl = 2/Ly; etagl = -cos(pi*(0:N)/N)'; ygl = ...

22 hours ago | 0

Split non-bijective function into two bijective regions
x = [4;2;3;6;6.5;4.5;1;1.5;3.5;2.5;5;6.2;2.8;6.3]; y = [5.5;6.5;1;4;1.5;1;2;7;6;1.8;5;1;6.2;3]; % TSP to order the data, See...

1 day ago | 1

| accepted

Why is there a difference in computing least squares although same symbolic operator \ is used?
"I'm guessing for my case only the documentation of page * matters? " Yes For numerical case and vector of RHS b x = A\b is ...

2 days ago | 0

| accepted

Does parfor inside lsqnonlin with UseParallel=True work properly?
If your function use parfor internally then you should NOT set UseParallel to true.

2 days ago | 0

Help finding datapoints in x,y falling outside the boundaries of a polygon. Incongruencies between inpolygon and inpoly2, time issues, and possible solutions
The reason that inpoly2/insidepoly fail because the polygons p1 and p3 have holes, therefore px.Vertices have NaN values. Here ...

2 days ago | 0

generate a plane that has the coordinates of a 3D matrix as its boundary
Why don't you do the very obvious? load('C.mat') patch(C(:,1),C(:,2),C(:,3),'k') hold on plot3(C(:,1),C(:,2),C(:,3),'g.','Ma...

3 days ago | 0

| accepted

can i velocize it? (if possible to vectorize)

3 days ago | 0

| accepted

clc command window restore
From MATLAB windows go to the menu Layout -> Command History -> Dock. You then have a tab "Command History" appears on the right...

4 days ago | 0

How can I log commands being executed by matlab? Like diary() but for all function calls.
Check out profile see if it meets your need.

5 days ago | 1

calculate the normal for a plane passing through more than three points

5 days ago | 0

| accepted

Changing default encoding of MATLAB
I see someone succeed in older MATLAB by editing the file [matlabroot '\bin\lcdata.xml'] Ref in this thread https://www.math...

6 days ago | 0

| accepted

Dynamic Assign Field Access in MATLAB Structures
clear s=struct('a',1,'b',2,'c',3) % this is a dirty command that pops the field values to the workspace cellfun(@(f) assignin...

6 days ago | 0

Skipping iteration on child throwing a warning
Modification of script_Z for k = 1:200 lastwarn('',''); % clean the warning state x = input_postprocessed_1/input_pos...

7 days ago | 1

| accepted

(Matlab Coder)Domain error. To compute complex results from real x, use 'acosd(complex(x))'
"Obviously, the a,b I gave are equal and the val value should be equal to 1" wrong. Before claming anything, you should first c...

7 days ago | 0

| accepted

Compute group statistics when the group definition is an OR of values found in several columns of a table
I submit a method without loop. I expected to be faster but to my surprise it is slower than v2. But at least it is scalable. %...

7 days ago | 0

| accepted

Why I am getting "Matrix is singular to working precision"?
The warning message is there "Matrix is singular to working precision" because your equations are dependent % 2*w+3*x+y-11*z =...

7 days ago | 0

how to effectively find a starting point for fzero?
The problem is not finding the right starting point, the problem is that your function func implementation returns NaN for large...

7 days ago | 0

How to estimate 95% probability contour in bivariate kernel density function MATLAB
I'm not sure if there is a standard definition of area of 95 confidence in 2D pdf since it like asking what if the shape of 95% ...

8 days ago | 0

How to keep the values for particular dimension of a matrix and rest of the dimension will be zeros?
A single line solution A(~(ismember(1:size(A,2),350:400) & ismember((1:size(A,1))',20:35))) = 0

8 days ago | 0

Finding value in Matrix to corresponding minvalue Position in different Matrix
A=randi(10,5) B=randi(10,5) [Amin,jmin]=min(A,[],2) % Amin is A(sub2ind(size(A),(1:size(A,1))',jmin)) % Bmin = B(sub2ind(si...

8 days ago | 0

| accepted

generate new coordinates (starting from initial coordinates) that are arranged outwards (by a distance H) and on the same plane
load('trace.mat') mt = mean(trace); dt = trace-mt; [~,~,V]=svd(dt); Q=V(:,[1:2]); t2D = dt*Q; [~,is]=sort(atan2(t2D(:,...

8 days ago | 0

| accepted

What will be a suitable option to circumvent a non-invertible matrix?
When you encount warning message like this, the first thing to ask is not "how do I change linear inversion algorithm?", but "wh...

8 days ago | 0

Determine the intersection coordinates between a 3D object and an infinite plane
Mesh your plane then use this https://www.mathworks.com/matlabcentral/fileexchange/49160-fast-mesh-mesh-intersection-using-ray-...

9 days ago | 0

| accepted

How to tune matrices to specific output?
Use lsqnonlin (or such) if you have optimization toolbox.

9 days ago | 1

| accepted

Converged to an infeasible point
I interpret fmincon message for you : Your system is not really controllable and the solution of the final step is driven by the...

9 days ago | 0

I will find an xy dataset satisfying an implicit equation.
f = @(x,y)(x.^2 + y.^2).^3 + (15.*x + 3.3.*y).*(x.^2 + y.^2).^2 + (62.5.*x.^2 + 20.*x.*y - 8.37.*y.^2).*(x.^2 + y.^2) - 17.*x.^3...

9 days ago | 0

| accepted