【发布时间】:2014-05-12 16:56:11
【问题描述】:
我想在下表中绘制现有值:
我希望得到如下图所示的曲线:
这是我的代码:
clc
clear all
close all
time=0:0.225; %time interval in s
Er=0:0.69; %energy interval in J
M=[1 5 25 51.2 52428.8 104857.6 209715.2];%[20Byte 100Byte 500Byte 1kByte 1MByte 2MByte]
En=0.00653; %energy for 20Byte in mJ
T=[0.000002125 0.000010 0.000053 0.000108 0.115 0.222]; %Time for 20Byte s
for i=1:length(M)
for j=1:length(T)
z(i,j)=(M(i)*En)+T(j); %#ok<SAGROW>
end
end
grid on
semilogx(z, 'bo-')
%legend('20 Byte','100 Byte','500 Byte','1 KByte','1 MByte','2 MByte')
title('Comparison ','FontSize',11)
ylabel('Energy Consumption','FontSize',11)
xlabel('Time in second','FontSize',11)
grid on
hold all
你能告诉我我应该如何实现关于表格的逻辑图
【问题讨论】: