STR2VAR

Version 1.0.0.0 (1.25 KB) by Thomas
Returns the variable or array of variables, VAR, matching the pattern STR.
869 Downloads
Updated 11 Jan 2010

View License

FUNCTION VAR = STR2VAR(STR)

Returns the variable or array of variables, VAR, matching the pattern STR. Matching variables must be of same type.

a = 3;
b = str2var('a'); % b is now equal to a, i.e. 3.

a1 = 3;
a2 = 2;
b = str2var('a*'); % b is now an array with values [3, 2].

Cite As

Thomas (2024). STR2VAR (https://www.mathworks.com/matlabcentral/fileexchange/26341-str2var), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0