How export the project to MatLab 2023 workspace. In Control System Designer

10 views (last 30 days)
I am using the Control System Designer to find the root-locus plot of a MIMO system.I want to export these root-locus plots to tradtional MATLAB figures in some way so that I can automatically save them. I am not sure how to couple the Control System Designer interface and the main MATLAB workspace.

Answers (1)

Maneet Kaur Bagga
Maneet Kaur Bagga on 11 Jul 2024
Hi,
I understand that you want to import root-locus plots from the Control System Designer to MATLAB figures.
One of the possible workaround for the same is extracting the data from the Control System Designer and then plotting it manually in MATLAB.
Please refer to the following steps as a possible workaround:
  • Open Control System Designer and Generate "Root-Locus" plot.
  • Export the system data and use it in MATLAB to recreate the root-locus plot. To extract the system data you can use the following command in the MATLAB Command Window.
% Assume `sys` is your system object in the Control System Designer
% Export your system to the workspace
sys = tf(your_system_in_CSD);
  • Use the "rlocus" function in MATLAB to plot the root locus. Please refer to the following code snippet as an example.
% Plot the root-locus
figure;
rlocus(sys);
% Customize plot if needed
title('Root-Locus Plot');
xlabel('Real Axis');
ylabel('Imaginary Axis');
% Save the figure
saveas(gcf, 'RootLocusPlot.png');
Please refer to the following MathWorks documentation for "rlocus" function.
Hope this helps!

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!