In R2024b how to read the Y tick labels of a bode plot
    5 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Harm
 am 7 Mär. 2025
  
    
    
    
    
    Kommentiert: Sulaymon Eshkabilov
      
 am 7 Mär. 2025
            In matlab 2024b how do I read the Y tick labels of a bode plot? Here is an example script that works in R2022b
sys = rss(1);
figure;
bode(sys)
axis = gca;
points = get( axis , 'Ytick' );
Which gives the result
points =
-15   -10    -5     0
But in R2024b it gives the error Unrecognized property Ytick for class controllib.chart.BodePlot.
Any ideas how to do this in this version?
0 Kommentare
Akzeptierte Antwort
  Sulaymon Eshkabilov
      
 am 7 Mär. 2025
        Here is the corrected code:
% TF of the given system:
sys = rss(1);
% BODE Plot:
H=bodeplot(sys); % Generate Bode plot and get handle
% Get MAG and PHASE axes handles:
AX = findall(gcf, 'Type', 'axes');
% Extract Y-tick LABELS:
MAG_yticks = yticks(AX(1)); % MAGNITUDE plot
MAG_yticklabels = yticklabels(AX(1));
PHASE_yticks = yticks(AX(2)); % PHASE plot
PHASE_yticklabels = yticklabels(AX(2));
% Display the RESULTS:
disp('MAG Y-tick Labels:');
disp(MAG_yticklabels);
disp('PHASE Y-tick Labels:');
disp(PHASE_yticklabels);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Axis Labels finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
