Hi
I have following array which contains of 3x1 double:
I'd like to convert it to a string and insert it into a text with strcat which only works with strings.
for k = 1:size(Polygons,2)
Color_Interpolated{k} = num2str(Color_Interpolated{k});
end
Unfortunately, my string looks now like this:
How can I change this to a 1x3 double that the eventual output is like 0 0.667 0.667 ? I need to convert it later to a string.
Below I combine all the strings together, and I need to transpose it to match the dimensions. I used reshape too, with the same results.
for k = 1:size(Polygons,2)
Complete_File{k} = strcat(Shape, Color_Interpolated{k});
Complete_File{k} = transpose(Complete_File{k});
Complete_File{k} = strcat(Complete_File{k}, Geometry,...
Assoc_Polygons{k}, coordIndex);
end
Complete_File_table = cell2table(Complete_File);
writetable(Complete_File_table,'Test.txt');
The text file looks now like this:
Shape
{
appearance Appearance {
material Material {
Color 0 }
}
geometry IndexedFaceSet
So the color is not inserted correctly, I think if the cells in Color_Interpolated are correct the text insert will be correct too.
Best regards
0 Comments
Sign in to comment.