Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • c19dbeb
  • /
  • boxArea.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:f18b401e7c1512dec8bee9b34bfcd1f5e2be45b5
directory badge
swh:1:dir:c19dbeb6c3e76be9a5a2efb82983db1c4038ed96

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
boxArea.m
function [targetArea] = boxArea(wavelength, MFP, z, x, y)
%BOXAREA create target area in a shape of 2D rectangle or 3D square box.
%
%   targetArea = boxArea(wavelength,scatteringMFP,z,x) defines the
%   wavelength,Mean Free Path, and diamentions of 2D rectangle target area.
%   * z is the depth of the rectangle, defined as 2 elements vector, where
%   the rectangle depth is defined from z(1) to z(2).
%   * x is the width of the rectangle, defined as 2 elements vector, where
%   the rectangle width is defined from x(1) to x(2).
% 
%   targetArea = boxArea(wavelength,scatteringMFP,z,x,y) defines 3D square
%   box, where the height defined from y(1) to y(2).
%
%   Class support for inputs wavelength, MFP:
%      float: double scalars
%
%   Class support for inputs z, x, y:
%      float: double
%
% SEE ALSO: mccov
%

% Check input num
narginchk(4,5);

if(~isscalar(wavelength) || ~isscalar(MFP))
    error('wavelength and MFP are scalars');
end

if(numel(z) ~= 2 || numel(x) ~= 2 || (nargin == 5 && numel(y) ~= 2))
    error('x, y and z defined as 2 elements vectors');
end

if(~isreal(z) || ~isreal(x) || (nargin == 5 && ~isreal(y)))
    error('x, y and z are real values');
end

if(z(1) > z(2))
    error('z(1) must be smaller than z(2)');
end

if(x(1) > x(2))
    error('x(1) must be smaller than x(2)');
end

if(nargin == 5 && y(1) > y(2))
    error('y(1) must be smaller than y(2)');
end

targetArea.type = 'targetArea';
targetArea.wavelength = wavelength;
targetArea.MFP = MFP;
targetArea.z = z;
targetArea.x = x;

if(nargin == 4)
    targetArea.D = 2;
end

if(nargin == 5)
    targetArea.D = 3;
    targetArea.y = y;
end

end

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API