Code covered by the BSD License  

Highlights from
OpenStreetMap Functions

image thumbnail
from OpenStreetMap Functions by Ioannis Filippidis
Load map, extract connectivity, plot road network & find shortest paths from OpenStreetMap XML file.

textmd(x, str, varargin)
function [varargout] = textmd(x, str, varargin)
%TEXTMD     Text annotation in 2D or 3D.
%
% input
%   x = point where text is placed
%     = [#dim x 1]
%   str = annotation text string
%
% File:      textmd.m
% Author:    Ioannis Filippidis, jfilippidis@gmail.com
% Date:      2012.01.22 - 
% Language:  MATLAB R2011b
% Purpose:   multi-dimensional text annotation
% Copyright: Ioannis Filippidis, 2012-

ndim = size(x, 1);

if ndim == 2
    y = x(2, 1);
    x = x(1, 1);
    h = text(x, y, str, varargin{:} );
elseif ndim == 3
    z = x(3, 1);
    y = x(2, 1);
    x = x(1, 1);
    h = text(x, y, z, str, varargin{:} );
end

if nargout == 1
    varargout{1, 1} = h;
end

Contact us