Filter löschen
Filter löschen

Fitting datapoint to a x-axis on a figure

1 Ansicht (letzte 30 Tage)
Lily
Lily am 2 Mär. 2014
Bearbeitet: the cyclist am 2 Mär. 2014
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

Akzeptierte Antwort

the cyclist
the cyclist am 2 Mär. 2014
Bearbeitet: the cyclist am 2 Mär. 2014
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.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by