Graph with string variable
古いコメントを表示
Hey guys,
I've just become very familiar with Matlab, but I'm having trouble building a graph:
on the X axis I would like to have the years and the values of the exports of manufactirial and food goods in order.
I don't know the code to use
thanking you in advance
attached my file
採用された回答
その他の回答 (2 件)
Jan
2019 年 6 月 19 日
You did not even make an attempt?
data = readmatrix('data.xlsx');
plot(data(:, 1), data(:, 2), 'r', ...
data(:, 1), data(:, 3), 'b');
Star Strider
2019 年 6 月 19 日
Try this:
[D,S] = xlsread('data.xlsx');
Years = str2double(S(2:end,1));
figure
plot(Years, D)
grid
legend(S(1,2:3))
producing:

1 件のコメント
Star Strider
2019 年 6 月 19 日
@Zongo Amara Mohamed Isaac —
If my Answer helped you solve your problem, please Accept it!
カテゴリ
ヘルプ センター および File Exchange で 2-D and 3-D Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!