version 1.0.1 (1.6 KB) by Micke Malmström
generates a legend based on the numbers in an array


Updated 25 May 2022

View License

ARRAY2LEGEND(Data,PreStr) generates a legend based on the numbers in the specified variable Data
legendHandle = array2legend(Data,{Prestr Poststr},pattern)
with a defined Pre-string and optionally a Post-string and or string-pattern. The basic code that is run at the end is:
legend(num2str(Data(:),[str{1} pattern str{2}]))
Alternative use:
% or
matrix2legend(Data,Prestr, Poststr)

Cite As

Micke Malmström (2022). array2legend (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!