Answered
Creating a projection of a surface on a plane for area calculation.
Could someone please give me guidance on how to create a projection of the tetrahedron on the x-z plane? Just throw away the y-...

3 years ago | 0

Answered
How to determine corresponding points between two 3d coordinate systems?
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horn-s-method v1 = [...

3 years ago | 0

| accepted

Answered
Identify two coordinates on the X-axis and Y-axis of a 3D object
[x,y]=deal(data(:,1),data(:,2)); [~,xmin]=min(x); [~,xmax]=max(x); [~,ymin]=min(y); [~,ymax]=max(y); points = data([xmi...

3 years ago | 0

| accepted

Answered
Linprog => constraint that x1 and x2 are not allowed to be both unequal from zero
Assuming this is a 2D problem, as you seem to imply, you could solve under the assumption that x1=0 and then under the assumptio...

3 years ago | 0

Answered
How to change all elements of a vector V to achieve the condition sum(V) equal with a upper and lower boundaries?
V=[0.1 0.002 0.5 0.2 0.1 0.003 0.4]; lp=0.01; up=0.8; n=numel(V); V(:)=(1-n*lp)/n+lp sum(V) V>=lp V<=up

3 years ago | 1

Answered
Sort elements of Array by given condition
n=load('vector').xr; m=numel(n); n=n(randperm(m)); loc=find(([n ;0]-[0 ;n])>0); n(loc(68):end)=sort(n(loc(68):end),'de...

3 years ago | 1

| accepted

Answered
Passing variable in function instead of the actual literal number causes problems
Easier: n=int32(11); b = bitget(n,8:-1:1)

3 years ago | 1

Answered
How to merge cell
{cell2mat(v)}

3 years ago | 0

| accepted

Answered
How to extract matrix elements?
You can access them by indexing: syms x M=[x 2*x 3*x; 4*x 5*x 6*x; 7*x 8*x 9*x]; M(2,3) However, you should be mindful t...

3 years ago | 1

| accepted

Answered
Small squares that appear when detecting objects with blobanalysis and foregroun detector. Does anyone know of a way to prevent this?
If I have to make a generalization, it occurs on asphalt and empty places in the videos in the highway environment. If so, then...

3 years ago | 0

Answered
Finding closest circle to a general circle
Here's another possible method using pdist2. Assume we have Nx3 matrices XYZ1, XYZ2 whose rows are the points (x,y,z) on orbit ...

3 years ago | 0

| accepted

Answered
Sort Cell Array after accumarray function
row_f=[0;0;0;1;2;3;4;0]; row_s=({'a';'a';'b';'b';'c';'c';'a';'b'}); t={'12/09/2022 04:28:01 PM';'12/09/2022 04:28:02 PM';'12/0...

3 years ago | 0

| accepted

Answered
How to solve 'n' number system of equations
It appears to me that the equation can be re-arranged quite easily into a set of linear equations in P, or which is ...

3 years ago | 0

| accepted

Answered
Help to convert C++ to Matlab
function main % Specific heat capacity of liquid water: Cp = 4.18 J/g/°C Cp = 4.18; % Mass of water in grams ...

3 years ago | 0

Answered
How to fit a normal distribution curve to a bar graph?
One way, load diftn x=(1:numel(diftn))'; fobj=fit(x,diftn,'gauss1'); plot(fobj,x,diftn)

3 years ago | 0

| accepted

Answered
Acces double inside cell array
for i=1:size(Results,1) Measurements(i).Det.J=J{i}; end

3 years ago | 0

| accepted

Answered
Finding closest circle to a general circle
You can use this FEX download to fit an ellipse or circle to the points, https://www.mathworks.com/matlabcentral/fileexchange/8...

3 years ago | 0

Answered
Pass a symbolic function as input to a function without passing its inputs
You seem to have answered your own question... function [g,d]=Test(f,par) g=gradient(f,par); args=argnames...

3 years ago | 0

Answered
Matching points between two point sets.
You would probably have to use ransac.

3 years ago | 0

Answered
How can I create a for loop when the range is changing
Crescendo = [0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 0]'; Descrescendo = [1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 0 0]'; Staccato = ...

3 years ago | 0

Answered
How to optimise a big loop with polyshape, intersection and area?
The implementation below works by iterating over 25x25 sub-blocks of the lon/lat data. On my computer, each block takes about 2....

3 years ago | 0

| accepted

Question


Why does blockproc return empty?
The blockproc documentation says that the block function can return a vector. Mine does so and prodcues non-empty output, as dem...

3 years ago | 1 answer | 0

1

answer

Answered
How to optimise a big loop with polyshape, intersection and area?
Here's a more vectorized version. I could not test it, of course, since input data was not provided to us. [m,n]=size(lat); ...

3 years ago | 0

Answered
register axis to point cloud
Here is an optimization implemented with fmincon. It achieved a lower registration error dist2Lines than my other answer, though...

3 years ago | 0

| accepted

Answered
Fast matrix product where one matrix is sparse [Ed. and diagonal] and the other is a Kronecker product
This alternative seems to give substantial speed-up (at least 100x): n = 1e4; r = 4; B = rand(n, r); a = zeros(1, n^2); a(r...

3 years ago | 1

| accepted

Question


Cloning a view of the slice planes (as seen in the Volume Viewer App) to a different volume
As shown below, the volume viewer app has an Export menu option, allowing one to export camera settings and thereby reproduce th...

3 years ago | 1 answer | 1

1

answer

Answered
Fastest selection of a coordinate in 3d array that fulfills a condition?
Why not as follows? I don't know if it's as fast as you were hoping, but it definitely doesn't take seconds per iteration. T=ra...

3 years ago | 1

Answered
Quickly extract the diagonal blocks of matrix product
X=rand(10,4); %hypothetical input blockLengths=[4,2,3,1]; [n,r]=size(X); Xcell=cellfun(@sparse,mat2cell(X,blockLengths,...

3 years ago | 0

| accepted

Load more