フィルターのクリア

I need to draw the annexed Excel draw with MATLAB code

3 ビュー (過去 30 日間)
Moustafa Abedel Fattah
Moustafa Abedel Fattah 2024 年 4 月 11 日
回答済み: Voss 2024 年 4 月 11 日
I have a draw with Excel and I need please a MATLAB code to redraw it
Please see the annexed file
Thanks in advance

回答 (1 件)

Voss
Voss 2024 年 4 月 11 日
x = [-5.5,-5,-4.5,-3.5,-2.5,-1.5,0,1.5,2.5,3.5,4.5,5,5.5];
y = [-0.002,-0.004,-0.005,-0.008,-0.008,-0.014,-0.014,-0.014,-0.008,-0.008,-0.005,-0.004,-0.002];
xi = linspace(min(x),max(x),100);
yi = interp1(x,y,xi,'spline');
figure();
hold on
plot(x,y,'.', ...
'Color',[0.65,0.65,0.65], ...
'MarkerSize',10)
plot(xi,yi,'-', ...
'Color',[0.65,0.65,0.65], ...
'LineWidth',1.5)
h_lgd = plot(NaN,NaN,'.-', ...
'Color',[0.65,0.65,0.65], ...
'MarkerSize',10, ...
'LineWidth',1.5);
legend(h_lgd,'g_M', ...
'Location','SouthOutside', ...
'Interpreter','none', ...
'Box','off')
ax = gca();
set(ax.Title, ...
'String','g_M', ...
'Interpreter','none', ...
'FontSize',12, ...
'VerticalAlignment','bottom', ...
'Position',[0 0.0025], ...
'FontWeight','normal')
set(ax, ...
'XLim',[-8,8], ...
'YLim',[-0.016,0], ...
'XAxisLocation','origin', ...
'YAxisLocation','origin', ...
'XGrid','on', ...
'YGrid','on', ...
'XMinorGrid','on', ...
'YMinorGrid','on', ...
'XTick',-8:2:8, ...
'YTick',-0.016:0.002:0, ...
'TickLength',[0 0], ...
'PlotBoxAspectRatio',[4 1 1], ...
'Box','on', ...
'FontSize',9)
ax.XAxis.TickLabelFormat = '%.3f';
ax.YAxis.TickLabelFormat = '%.3f';

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

タグ

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by