Answered
Equal area Delaunay-triangulated sphere
Use is suite functions on FEX

7 years ago | 0

Answered
Interpolation in the baricenter of a tetrahedron
1/4 sum values of 4 nodes

7 years ago | 0

| accepted

Answered
How can I get the screen coordinates from perspective projection?
This demo shows how the MATLAB 3D projective works, I'm not sure how CameraViewAngle is related to the size, so I do cropping by...

7 years ago | 1

Answered
What precisely is conv2(A,B,'same')?
For vectors A and B C = conv(A,B,'same') is equivalent to Cfull = conv(A,B,'full') C = Cfull(floor(length(B)/2) + (1:length...

7 years ago | 3

| accepted

Answered
Does unwrap function works for 2D data as well....?
No unwrap works for 1D only. If it seems to work on 2D you are just lucky, because your phase does not have noise and coherent. ...

7 years ago | 0

Answered
eigenvalues and eigenvector manual calculation
No cheating, this applies for 2x2 only A= [ 0.064911 3.276493; 3.276493 311.2073]; lambda=eig(A); % you should do it by...

7 years ago | 1

Answered
How to move points in a curve in the normal direction?
Try to reverse the sign before tol x_n(2, 1) = x_airfoil(i, 1) + +1*tol*(y_airfoil(i+1, 1)-y_airfoil(i, 1))/sqrt(((x_airfoil(i+...

7 years ago | 0

| accepted

Answered
replace one matrix with the positon indicated in another matrix
B(:,A)

7 years ago | 0

| accepted

Answered
how to get real value after IFFT without using abs() and real()
"But at first, I don't know the first term is special" The first term (after fftshift) is Niquist frequency, it is shared if th...

7 years ago | 1

| accepted

Answered
Least square fit (regression analysis)
The y vector must be column r = inv(A1'*A1)*(A1'*y(:));

7 years ago | 0

| accepted

Answered
Projection of a point onto a closed convex
Use this FEX Q=[50;5000]; % Projection candidates on x.^2-2*x-y-1 = 0 P=ConicPrj(Q,[1 0; 0 0],[-2;-1],-1); % Find the clos...

7 years ago | 1

| accepted

Answered
How can I check a known point cooradinates (x,y) if it belongs to a to Triangle which is known vertices coordinates v1,v2,v3 ??
vx = [v1(1) v2(1) v3(1)] vy = [v1(2) v2(2) v3(2)] inpolygon(x,y,vx,vy)

7 years ago | 1

| accepted

Answered
error:An array for multiple LHS assignment cannot contain expressions.
Remove the parenthesis [theta04,theta02,dtheta4,dtheta2,ddtheta4,ddtheta2] = InverseRR...

7 years ago | 0

| accepted

Answered
Integrate a function over a triangle area
Here is a method. Assuming you triangle T has 3 vertexes P1, P2, P3, each vertex Pi has corrdinates (xi,yi). Any point P insid...

7 years ago | 1

Answered
how can i seperate the value exp(1i*2*pi*bbbb);
"i want to find the value of x1 from the d1" x1 = d1/abs(d1) if bbbb is real. You need a major update of complex number the...

7 years ago | 0

Answered
How to choose values ​​in the second and third column corresponding to the drawn numbers?
Why make so complicated? RANDPERM returns the position, store and use it rather than trying to recover it. AA=[ 1 0 4 2 1 5 ...

7 years ago | 1

Answered
Surf function with interp: symmetric surface shown assymmetrically
The color interpolation carried out by MATLAB is not symetric by values but also by order. This induces the defect. To trick MA...

7 years ago | 3

| accepted

Answered
How to randomize a specific number of 0s and 1s so that 0s always precede at least two 1s?
n = 170+70; % length of the array n0 = 70; % number of 0s should not larger than n/3 assert(3*n0<=n,'density of n0 too large...

7 years ago | 0

Answered
How do I write a program using MATLAB to find the circumference of a area (white) using the unit as a pixcel (i ever Used to command g = regionprops (label, 'Area');)
Assuming your binary is Img with one connexed component c = contourc(double(Img),[1 1]); c = c(:,1+(1:c(2,1))); d = diff(c(:,...

7 years ago | 1

Answered
Function‘round’. Numerical calculation question
Welcome to the work of floating point arithmetic >> (6/40000)*10000-1.5 ans = -2.2204e-16 >> So actually the calcu...

7 years ago | 2

Answered
Adding sparse matrices efficiently?
The fatest way to add sparse matrices is to build the sum from scratch. It takes 4 second for 1000 random matrices of 4000x4000...

7 years ago | 0

Answered
Scale Matrix Dimensions by Factor
>> repelem([1 2 3],3) ans = 1 1 1 2 2 2 3 3 3 >>

7 years ago | 0

| accepted

Answered
Solve a cubic equation using MATLAB code
Please download this FEX, There is a file called CardanRoots.m w = linspace(-3,3,10); a = 2./w; b = (3./w+3); c = (4./(w-9...

7 years ago | 2

Answered
i want to change [3,2,4](1x3 matrix) to 324(1x1 matrix) any help?
This one produces NaN for overflowed data >> polyval([3 2 4],10) ans = 324 >> str2double(char([3 2 10]+'0')) ans...

7 years ago | 0

Answered
i want to change [3,2,4](1x3 matrix) to 324(1x1 matrix) any help?
>> str2double(char([3 2 4]+'0')) ans = 324 >>

7 years ago | 1

Answered
How to find the number of occurrences of a particular sequence inside the cell array?
C = {[1; 2; 3]; [1; 2; 3; 4]; [4; 1; 2; 3]; [1; 2]}; sequence_check = [1; 2; 3]; n = sum(cellfun(@(x) ~isempty(strfind(x.',...

7 years ago | 1

| accepted

Answered
accumarray function for equal integer values
B1 = [34.1; 34.2; 35.6; 35.7]; B2 = [600; 800; 200; 100]; Br1 = round(B1); u = unique(Br1); [~,J] = ismember(Br1, u); B2s...

7 years ago | 1

| accepted

Answered
How many times does a pair of value occur in a row?
dat = [1,3,2,4,1,1,2,4,1,4,4,4,3; 2,1,4,3,2,2,2,4,1,1,1,2,3] x = permute(dat,[2 3 1]); x = sort([x(1:end-1,:,:),x...

7 years ago | 0

| accepted

Answered
replace all values of cells between two positions
Second solution, use this File Exchange MCOLON new_matrix = matrix; new_matrix(mcolon(onsets_row1,offsets_row1)) = NaN;

7 years ago | 0

Answered
replace all values of cells between two positions
new_matrix = matrix; for k=1:length(onsets_row1) new_matrix(onsets_row1(k):offsets_row1(k)) = NaN; end

7 years ago | 1

Load more