could anyone help me to plot the graph with equal spacing of number with respect to x axis

10 次查看(过去 30 天)
I want to plot the graph with respect to x axis using the following (1,12,25,100,120). In the graph i should get only these 5 numbers with equal spacing. I tried with several commands like but none give me the result what i actually need.
Could anyone help me to solve the issue.

采纳的回答

Von Duesenberg
Von Duesenberg 2018-3-29
xDat = [1,12,25,100,120];
dummyX = 1:length(xDat);
yDat = randperm(length(xDat));
plot(dummyX, yDat, 'ko');
ax = gca;
ax.XTick = dummyX;
ax.XTickLabel = xDat;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by