Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Hi i am a beginner user of MATLab i want to know how to scale my interval level at X and Y axis

1 Ansicht (letzte 30 Tage)
i want the scale as shown in part 2 of my image . i only have find a function related to scaling axis([0,10,-1,1])but it only define limit for example initial and final threshold but it not solve my issue . please help me
  2 Kommentare
Star Strider
Star Strider am 27 Feb. 2016
... ‘but it not solve my issue’ ...
Please tell us: what is your issue?
Nazish khan
Nazish khan am 1 Mär. 2016
thanks @ star strider for replying me
my code and output is in figure i want to learn ho change how to adjust scaling as my teacher give me assignment to give exact points at 0.1 0.2 0.3 0.4 0.5 0n X axis and 0 1 2 3 4 on Y axis but my figure show 0 0.5 1 1.5 2 2.5 3 3.5 4 help me to adjust it please

Antworten (1)

Image Analyst
Image Analyst am 27 Feb. 2016
Try this:
% Plot data
x = linspace(0, 10, 100);
period = 4.6*4/3;
y = sin(2 * pi * x / period);
plot(x, y, 'b*-', 'LineWidth', 2);
grid on;
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
% Adjust tick marks.
ax = gca; % Get handle to current axes
% Set x tick marks to 0 to 10 in steps of 2.
ax.XTick = 0 : 2 : 10;
% Set y tick marks as -1 to +1 in steps of 0.5
ax.YTick = -1 : 0.5 : 1;
  2 Kommentare
Nazish khan
Nazish khan am 1 Mär. 2016
can you give me any other solution please my code and figure is attach here i want adjustment of my scaling on Y axis only show 0 1 2 3 4 and on X axis only show 0.1 0.2 0.3 0.4 0.5 can you re modify my code according to my requirement please

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by