Plot a graph from the given table

2 ビュー (過去 30 日間)
Sreeja Poreddy
Sreeja Poreddy 2021 年 2 月 26 日
コメント済み: Sreeja Poreddy 2021 年 2 月 27 日
I want to plot this table and graph in matlab. Can anyone help me with this.
  1 件のコメント
Sreeja Poreddy
Sreeja Poreddy 2021 年 2 月 26 日
x=[1 2 3 4 5 6 7 8 9 10 11]';
y1=[34 81 92 94 211 222 233 234 312 336 372]';
y2=[36 98 100 108 254 275 275 275 350 350 381]';
y3=[2 17 8 14 43 53 42 41 38 14 9]';
f=figure;
subplot(121);
plot(x,y1,y2,y3);
data=[x,y1,y2,y3];
colNames={'X-Data','Y-Data'};
t=uitable(f,'Data',data,'Position',[300,100,200,300],'ColumnName',colNames);
I tried doing it like this, But it does not seem to be working.

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 27 日
編集済み: KALYAN ACHARJYA 2021 年 2 月 27 日
Graph:
Please do learn about line/plot design here
simu_result=[34 81 92 94 211 222 233 234 312 336 372];
ana_result=[36 98 100 108 254 275 275 275 350 350 381];
dif_data=ana_result-simu_result;
plot(case_data,simu_result,'-sb','MarkerEdgeColor','k','MarkerFaceColor','b');
hold on;
plot(case_data,ana_result,'-dr','MarkerEdgeColor','k','MarkerFaceColor','r');
plot(case_data,dif_data,'-vy','MarkerEdgeColor','k','MarkerFaceColor','y');
ax = gca;
ax.XGrid = 'off';
ax.YGrid = 'on';
xlim([1 11]);
ylim([0 450]);
ylabel('Counter Increments');
xlabel('Case');
title('Simulated vs. Analytical Values')
Hope you can do add legend
For Table:
T=table(simu_result',ana_result',dif_data');
T.Properties.VariableNames={'Simulation Result' 'Analytical Result' 'Difference'}
T
  1 件のコメント
Sreeja Poreddy
Sreeja Poreddy 2021 年 2 月 27 日
Thank you so much! It's working.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by