Answered
why can we not modify inherited properties
Well, I'm not a Mathworks developer, but here are my thoughts: Regarding default values, I believe they must be non-overridabl...

5 years ago | 0

| accepted

Answered
How to make Triangle to Triangle Intersection Algorithm ??
But I want Intersection in 3D space Can U one more help for me?? You can use intersectionHull() in this File Exchange submissi...

5 years ago | 0

Answered
Matrix Subtraction by taking mean of same matrix
It would be faster to use sepblockfun from the File Exchange, https://www.mathworks.com/matlabcentral/fileexchange/48089-separa...

5 years ago | 0

| accepted

Answered
Solving large system of linear equations
n=32; c(1,1)=5; c(n,1)=10; %Example data T=toeplitz([-1,zeros(1,n-3)], [-1,1,-1, zeros(1,n-3)]); A=T; A(:,[1,n])=[]; b=...

5 years ago | 0

| accepted

Answered
Error in calculate mean and standar deviation
Why not just data=readtable('E:\Sentinel-Cryosat\sentinel\full_Data_Sentinel_c2p0006.txt','HeaderLines',0);

5 years ago | 0

Answered
How to select rows that precede and follow a specific row with a certain value?
c=data(:,13); preError=data( c(1:end-1)==1 & c(2:end)==0 ,:); postError=data( c(1:end-1)==0 & c(2:end)==1 ,:);

5 years ago | 0

| accepted

Answered
Find a plane that is tangent to a part of the 3D model
Obtain all the mesh vertices from your stl file in V. Then, compute the facet areas and normals of the convex hull with, k=conv...

5 years ago | 1

| accepted

Answered
How to make Triangle to Triangle Intersection Algorithm ??
triangle1=polyshape([0 0 ; 1 0; 0 1]); triangle2=polyshape([0 0 ; 1 0; 1 1]); p=intersect([triangle1,triangle2]); tiledla...

5 years ago | 0

Answered
How to find the maximum deviation between x-values, given one y-value on a plot.
Perhaps as follows, F1=griddedInterpolant(OutputVoltage1, Temperature); F2=griddedInterpolant(OutputVoltage2, Temperature); ...

5 years ago | 1

Answered
Multi dimensional vector operation
L_squared=([hx(:),hy(:),hz(:)]\[rx(:),ry(:),rz(:)]).';

5 years ago | 1

| accepted

Answered
How to compute interior eigenvectors that exclude certain eigenvalues?
I was basically wondering if there was an eigenvalue algorithm where I could just specify as inputs (a, b) to compute all eigen ...

5 years ago | 1

| accepted

Answered
How to interpolate based on the first column in a matrix and fill the interpolated rows of the other columns with set values?
example = [3.0000 0.9172 0.3804 0.5308 0.5688 5.0000 0.2858 0.5678 0.7792 0.4694 ...

5 years ago | 0

| accepted

Answered
How to compute interior eigenvectors that exclude certain eigenvalues?
If you'll be computing the majority of the eigenvalues anyway, it would be faster to use eig() than eigs().

5 years ago | 0

Answered
Solve system of Linear Equations with Constraints.
[V,e]=eig(P.','vector'); [~,imin]=min(abs(e-1)); piVector=V(:,imin)/sum(V(:,imin));

5 years ago | 0

| accepted

Answered
3D interpolation using interp1
F=griddedInterpolant({1:m,1:n,z1},u); interp_u=F({1:m,1:n,z2});

5 years ago | 0

| accepted

Answered
Solving equation problem with constrains using the Optimization Toolbox
Use your first approach except specify a least squares objective, like below. x=optimvar('x','lower',0); y=optimvar('y','lowe...

5 years ago | 0

| accepted

Answered
How do I find the index of an object inside a several objects array?
Using findobj() or findall().

5 years ago | 0

| accepted

Answered
Intersection of circles and polygons?
This is similar to my other answer, but instead of approximating the circle as a polygon, it does an exact theoretical calculati...

5 years ago | 1

Answered
Intersection of circles and polygons?
If you approximate the circle as a polyshape as well, it is very easy to do with https://www.mathworks.com/matlabcentral/filee...

5 years ago | 1

| accepted

Answered
Blind Parametric Interpolation Fitting For A Set Of Points
Is there a way to compute the parametric equations of a point set completely blind without first knowing the parent function? N...

5 years ago | 0

Answered
Failure in initial objective function evaluation. FSOLVE cannot continue.
function F = poSTAR_14(x,Hm_RI,at_RI,J) F1=Hm_RI*x; F2=at_RI*x-[1;0]; F3=abs(x(1:32,1)).^2+abs(x(33:64,1)).^2-ones(J,1)...

5 years ago | 0

| accepted

Answered
How can I extrapolate point outside of given data
Instead of using x(1) and x(end) in yy=linspace(x(1),x(end),600); use whatever range limits you plan to plot over.

5 years ago | 0

| accepted

Question


For-loops are now faster than some of the simplest vectorized statements. Why do we still need so much deep copying?
It is disconcerting to me that the for-loop implementation of operations like x(i+1)*x(i) are now faster than the vectorized imp...

5 years ago | 2 answers | 4

2

answers

Answered
Classifying sparse matrix in parfor loop
The loop takes long to compute and I would like to use parloop to speed up the process. I doubt it will, but the loop can be f...

5 years ago | 0

| accepted

Answered
fmincon error occurs without details in Matlab
lsqlin would be better for this than fmincon. lb = [0,0]; ub = [1,1]; A = [1 1]; b = [1]; C=[200,0; 0 200; ...

5 years ago | 0

Answered
How do I plot a square given the length of the sides and the center of x and y?
One way, [x0,y0,L]=deal(2,1,4); %example input parameters p=polyshape( [x0,y0]+[-1 -1; -1 1; 1 1; 1 -1]*L/2 ); plot(p)

5 years ago | 1

| accepted

Answered
How do I get a profile from a point cloud?
Can the z-coordinates of the point cloud data be considered a function of (x,y)? If so, then, F=scatteredInterpolant(x,y,z); ...

5 years ago | 0

| accepted

Answered
How can I solve this problem using for loop?
v=[2 2 5 8]; for i=1 result=v(1:end-1)*v(2:end).' end

5 years ago | 0

Answered
fsolve yields wrong answer
I want to use fsolve to solve it as it is more efficient; however, it yields wrong answer: In your example, the function is a ...

5 years ago | 1

Answered
fsolve yields wrong answer
parts=@(z) [real(z);imag(z)]; complx=@(x) complex(x(1),x(2)); F = @(x)parts((complx(x)-20.6667)^2+57.89); opts = optimo...

5 years ago | 0

Load more