Answered
2x2 Projection matrix of rank 1
a=[1; 2]; n=[3; 4]; x=[5; 6]; r1p(a,n,a) r1p(a,n,n) r1p(a,n,x) function p = r1p(a,n,x) % computes the action of P, the ...

4 years ago | 1

| accepted

Answered
Constrained multiple linear regression with multiple dependent variables
lsqlin is applicable with, N=size(beta,1); C=kron(X.',eye(N)); d=Y(:);

4 years ago | 0

| accepted

Answered
How to get property validation functions to show source file location on error?
It is very difficult to identify where the error occured. Running in debug mode will take you to the point where the error occu...

4 years ago | 1

| accepted

Answered
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);

4 years ago | 0

| accepted

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

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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 ...

4 years ago | 0

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

4 years ago | 0

| accepted

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

4 years ago | 1

| accepted

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

4 years ago | 0

| accepted

Answered
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.

4 years ago | 1

| accepted

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

4 years ago | 0

| accepted

Answered
I have a new laptop but am having trouble transferring matlab onto it from old dead laptop
Just download it again onto the new laptio from the license center, https://www.mathworks.com/licensecenter/licenses/40773130/5...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

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

4 years ago | 0

Answered
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.

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

Answered
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 ...

4 years ago | 0

| accepted

Answered
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);

4 years ago | 0

Answered
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...

4 years ago | 0

Answered
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 ...

4 years ago | 0

Answered
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...

4 years ago | 0

| accepted

Load more