필터 지우기
필터 지우기

Fitting datapoint to a x-axis on a figure

조회 수: 1 (최근 30일)
Lily
Lily 2014년 3월 2일
편집: the cyclist 2014년 3월 2일
I'm trying to fit the x-axis on my figure so that there will be an nearly equal spacing between data points. Especially minimize the spacing between 100ms, 200ms, 400ms and 1000ms. Could you help me?
T = [0.05 0.1 0.2 0.5 1.2 2 6 12 21 50 100 200 400 1000]; %[ms]
I = [70 50 35 25 19 18 15 15 15 15 15 15 15 38]; %[mA]
figure (1)
plot(T,I,'m');
hold on
grid on
xlabel('Time [ms]');
ylabel('Current [mA]');
hold off

채택된 답변

the cyclist
the cyclist 2014년 3월 2일
편집: the cyclist 2014년 3월 2일
Maybe you want to plot on a log axis? Try the semilogx() command:
T = [0.05 0.1 0.2 0.5 1.2 2 6 12 21 50 100 200 400 1000]; %[ms]
I = [70 50 35 25 19 18 15 15 15 15 15 15 15 38]; %[mA]
figure (1)
semilogx(T,I,'.-m');
hold on
grid on
xlabel('Time [ms]');
ylabel('Current [mA]');
hold off
I also added markers at the data points, to make them stand out more.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by