Compare each row of data with another vector data
tmp=[discretize(A,[B(:,1);inf],'Inc','left'),... discretize(A,[-inf;B(:,2)],'Inc','right')]; out=all(tmp==tmp(:,1),2);

13 dagar ago | 0

| accepted

Compare each row of data with another vector data
out=any(A(:,1)>=B(:,1).' & A(:,2)<=B(:,2).',2);

13 dagar ago | 0

Interpolating 3D Gridded data at specific cordinates
[Long,Lat,Height] = deal(0:5:360,-90:5:90,0:15:600); %Fake data Temp = rand(73,37,41)*1000; LUT=griddedInte...

13 dagar ago | 0

| accepted

Optimize fair teams when team size is can vary.
Instead of using kron to set up your initial matrix idx, use blkdiag: nPlayers=17; minTeams=floor(nPlayers/5); %minimum numb...

13 dagar ago | 0

| accepted

can we solve linear matrix inequalities by using only matrix forms?
As Torsten says, A*x>b generally corresponds to not one x, but an entire polyhedral region of them. However, if the region is bo...

13 dagar ago | 0

How to extract the input values for an optimized output value in a GA optimizer
You have not shown us the code for the GA app that you are using, but generally speaking, there should be a line in there which ...

13 dagar ago | 0

How to rearrange tables
Boxes=tbl.BBOX; Labels=cellfun(@string, tbl.Class,'uni',0); newtbl=table(Boxes,Labels);

14 dagar ago | 0

| accepted

Interpolating 3D Gridded Data in Matlab
This might be easier: LUT= griddedInterpolant(Long1,Lat1,Height,Temp1,'linear','linear'); %create interp object newgrid=LUT....

14 dagar ago | 1

| accepted

Vector form of for loop?
e=norm(yo-ye).^2/M/N

14 dagar ago | 0

| accepted

Interpolation of time series of data at X and Y coordinates
Use scatteredInterpolant or griddedInterpolant depending on whether your (X,Y,t) data is scattered or gridded.

14 dagar ago | 1

| accepted

How to find coordinates of intersecting line?
fs= 8192*2; % sampling frequency dt = 1/fs; % sample time ...

14 dagar ago | 0

| accepted

I have a new laptop but am having trouble transferring matlab onto it from old dead laptop

14 dagar ago | 0

Solver stopped prematurely. fmincon stopped because it exceeded the function evaluation limit,
It's not an error. It's just telling you that it doesn't think it had a chance to run enough iterations. You can use optimoption...

14 dagar ago | 0

Not able to get the fit(using lsqcurvefit)
Your unknowns appear to be just linear coefficients of some set of basis functions. You should probably just solve for theta usi...

15 dagar ago | 0

how to make rectangle in circle?
[X,Y]=ndgrid(-10:10); r=arrayfun( @(x,y) nsidedpoly(4,'Center',[x,y],'Radius',1/sqrt(2)) , X(:),Y(:)); c=intersect(nsid...

15 dagar ago | 0

| accepted

How can I create an instance of a class in a method?
This worked fine for me. >> t=FuncTable(rand(1,5),rand(1,5)) t = FuncTable with properties: X: [0.8712 0.0816 0...

15 dagar ago | 0

Can parfor be used if no Parallel Computing Toolbox licenses are available?
You don't ned to check whether the Parallel Computing Toolbox is installed, as long as you don't try to run parfor on multiple w...

16 dagar ago | 0

Incorrect output of linear optimization problem
ls=[20000,20000,20000,20000,20000,20000,20000,20000,20000,20000]; CK=[500,600,700,800,900,1000,1100,1200,1300,1400]; TN=10; N...

16 dagar ago | 0

| accepted

Extracting groups of vector
You could try running clusterdata on the x-axis coordinates.

16 dagar ago | 0

Extract curve/surface from an 2-D area of points not equivalently spaced
I think it would be better to go back to the original image and use edge.

16 dagar ago | 0

GA linear constraints problem
I'm not sure why you are using ga() rather than linprog, but for the constraint you describe, the Aeq,beq constraint matrices wo...

17 dagar ago | 0

Vectorize Matrix Formation & Multiplication
N=length(t); a=reshape(a,1,1,N); B=zeros(3,3,N) ; B(1,1,:)=1; B(2:3,2:3,:)=[cos(a), sin(a); -si...

17 dagar ago | 0

| accepted

Reseting and refresing figure with tiledlayout/nexttitle
One possibility: A(2,2)=60; mtrx_surf(A) A(2,2)=30; mtrx_surf(A) function out = mtrx_surf(Z3) persistent srf ...

17 dagar ago | 0

| accepted

Elimination of for loops
L=2; T=1; w0=2*pi; N=3; ts=linspace(0,T,101)'; ts(end)=[]; w=w0+(0:N-1)/T; s=repmat(sum(exp(1j*ts*w) ,2).',1,L);

18 dagar ago | 0

Generate a formula from equation
L=3; T=1; w0=2*pi/(T/3); ts=linspace(0,T,101)'; ts(end)=[]; w=w0+(0:L-1)/T; s=reshape( exp(1j*ts*w) ,1,[]); t=lin...

18 dagar ago | 0

How can you calculate the change in angle(RotX,RotY,Rotz) of a normal vector (say of that of a flat mirror) to a normal vector of an average plane thru a deformed mirror?
The rotation angles to go from the undeformed to deformed normal vector are calculated. There is no unique rotation that will ...

18 dagar ago | 0

How do I fit a regression equation to find coefficients and exponents?
fminspleas from the File Exchange (Download) fared better, but it looks like a highly ill-conditioned data set: load('X_reg.mat...

18 dagar ago | 0

| accepted

How to implement theses constraints in the cost function ?
pso() doesn't have an input for such constraints. Maybe use ga() or patternsearch(). Here's how it would look when solved with ...

18 dagar ago | 0