I want to create a container (array, vector, ... I don't perfectly know the difference between these in Matlab) of strings. I want to use it for display purposes and printing to files mainly. In C++ I would have something like:
std::vector<std::string> str;
str.push_back( "Test1" );
str.push_back( "Test2" );
str.push_back( "Test3" );
for( unsigned int i = 0; i < str.size(); i++ )
{
printf( "%s\n", str[i].c_str() );
}
My question being: How can I achieve something similar in Matlab, or is it even possible. I've tried a few things I've found here and there but nothing works. Here are the things I tried:
str = ['Test1' 'Test2' 'Test3'];
str = ['Test1', 'Test2', 'Test3'];
str = ['Test1'; 'Test2'; 'Test3'];