I have this geometry file, which I don't understand. Can anyone explains what this line does?
case 1 bs = varargin{1}; boundary = [0,0.25,0.5,0.75; 0.25,0.5,0.75,1; 1,1,1,1; 0,0,0,0]; varargout{1} = boundary(:,bs);
I need to modify this file so that I replace the striaght lines, representing the edges by curved lines but first I need to understand what each line means .. This is the compelete m.file Thanks
function varargout = rechteckgeometrie(varargin)length = 0.05315;length2 = 0.07;width = 0.575;switch nargin case 0 varargout{1} = 4;case 1 bs = varargin{1}; boundary = [0,0.25,0.5,0.75; 0.25,0.5,0.75,1; 1,1,1,1; 0,0,0,0]; varargout{1} = boundary(:,bs);case 2 if isempty(varargin{1}) && isempty(varargin{2}) varargout{1,2} = []; else bs = varargin{1}; s = varargin{2}; boundary = [0,width,width,0,0; 0,0,length2,length,0]; varargout{1} = (bs-4*s).*reshape(boundary(1,bs),size(bs))+... (4*s+1-bs).*reshape(boundary(1,bs+1),size(bs)); varargout{2} = (bs-4*s).*reshape(boundary(2,bs),size(bs))+... (4*s+1-bs).*reshape(boundary(2,bs+1),size(bs)); endotherwise disp('Wrong number of input arguments');end%-----------------
figure; clf;pdegplot('rechteckgeometrie', 'edgeLabels', 'on');
Best Answer