MATLAB changing axis labes on step()/margin() functions help required please

  • MATLAB
  • Thread starter HeZ
  • Start date
  • #1
HeZ
10
1
Hi all,

I am having a little trouble with a matlab GUI that i am writing, with GUIDE. Its purpose is basically to display the bode diagram and step response of a transfer function, and allow the user to change controller parameters/time delays and such to see the affect. I wont post my code here, because it works perfectly. (unless anyone wants it)

The one thing i am having trouble with is changing the labels of the plots drawn by step/margin functions. My transfer functions are actually in minutes whereas the plot automatically labels the axis as seconds.

Margin looks like: 'Frequency (rad/sec)'
Step looks like : 'Time (sec)'

I have tried using xlabel('newLabel');
However what that just replaces the 'Frequency' Label with 'newLabel', whilst the (rad/sec) component remains.
This is the same deal for the step plot.

I have googled this extensively and cannot seem to find the answer :(

Thanks in advance,
Chris
 
  • Like
Likes MMG19

Answers and Replies

  • #2
Pythagorean
Gold Member
4,214
272
you can set these two properties: XTick XTickLabel

XTICK sets where the tick marks are, the label set WHAT they are (can be text)

Now, you can write a loop with sprintf to make a series of numbers into the text you want if you want to do HH:MM:SS time.

There's also a matlab function on the file exchange that might help:

http://www.mathworks.com/matlabcentral/fileexchange/15986
 

Related Threads on MATLAB changing axis labes on step()/margin() functions help required please

Replies
4
Views
3K
Replies
8
Views
13K
Replies
1
Views
5K
Replies
2
Views
2K
Replies
7
Views
90K
  • Last Post
Replies
1
Views
5K
Replies
9
Views
181K
Replies
3
Views
12K
Replies
1
Views
831
Top