-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
8,213 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
function Z = enclosePoints(points,varargin) | ||
% enclosePoints - enclose a point cloud with a zonotope | ||
% | ||
% Syntax: | ||
% Z = enclosePoints(points) | ||
% | ||
% Inputs: | ||
% points - matrix storing point cloud (dimension: [n,p] for p points) | ||
% | ||
% Outputs: | ||
% Z - zonotope object | ||
% | ||
% Example: | ||
% | ||
% References: | ||
% Other m-files required: none | ||
% Subfunctions: none | ||
% MAT-files required: none | ||
% | ||
% See also: interval, polytope | ||
|
||
% Author: Amr Alanwar | ||
% Written: 11-Aug-2020 | ||
% Last update: --- | ||
% Last revision: --- | ||
|
||
%------------- BEGIN CODE -------------- | ||
% [dim,numOfPoints] = size(points); | ||
% cen = []; | ||
% newpoints = []; | ||
% for i = 1:numOfPoints | ||
% if zeros(dim,1) ==points(:,i) | ||
% cen =zeros(dim,1); | ||
% else | ||
% newpoints= [newpoints points(:,i)]; | ||
% end | ||
% end | ||
% newpoints=unique(newpoints','rows')'; | ||
% | ||
% [row,cols] = size(newpoints); | ||
% for i = 1:cols | ||
% gen{i} = newpoints(:,i); | ||
% end | ||
|
||
%points=unique(points','rows')'; | ||
% cen =zeros(dim,1); | ||
% gen = {points}; | ||
points=unique(points','rows')'; | ||
[dim,numOfPoints] = size(points); | ||
cen = points(:,1); | ||
if numOfPoints > 1 | ||
containsZeroFlag=0; | ||
newPoints = []; | ||
for i =1:numOfPoints | ||
|
||
if points(:,i) == zeros(dim,1) | ||
containsZeroFlag =1; | ||
saveI = i; | ||
break; | ||
|
||
els | ||
end | ||
end | ||
|
||
if containsZeroFlag ==1 | ||
cen = points(:,saveI); | ||
for i =1:numOfPoints | ||
if i==saveI | ||
|
||
else | ||
gen{index} = xor(cen,points(:,i)); | ||
index = index +1; | ||
end | ||
end | ||
else | ||
index =1; | ||
for i =2:numOfPoints | ||
gen{index} = xor(cen,points(:,i)); | ||
index = index +1; | ||
end | ||
end | ||
Z =logicalZonotope(cen,gen); | ||
else | ||
Z =logicalZonotope(cen,{}); | ||
end | ||
Z=unique(Z); | ||
|
||
end | ||
|
||
%------------- END OF CODE -------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.