3D Plot of a Matrix with only Char data type
1 次查看(过去 30 天)
显示 更早的评论
- I have a matrix which with Char data type i.e All data are in text format.
- My goal is to make an x-y-z plot that will rep these data in an image format
- Can this be done in Matlab
- Data sample below
x= 'USA', 'Germany', 'South Africa', 'China', 'Mexico', 'Australia'
y = 'America', 'Europe', 'Africa', 'Asia', 'South America', 'Australia'
z= 'First world', 'Tech', 'Developing', 'Business', 'Work force', 'Medicine'
3 个评论
the cyclist
2021-10-5
@Cutie, perhaps take a look at the MATLAB Gallery, and think about which type of plot might be able to translate your type of data into a visualization.
回答(1 个)
Chunru
2021-10-5
x= {'USA', 'Germany', 'South Africa', 'China', 'Mexico', 'Australia'};
y = {'America', 'Europe', 'Africa', 'Asia', 'South America', 'Australia'};
z= {'First world', 'Tech', 'Developing', 'Business', 'Work force', 'Medicine'};
% convert string to categorical (numerical)
xc = categorical(x);
yc = categorical(y);
zc = categorical(z);
% plot the result, eg. stem3
figure
stem3(xc, yc, zc)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!