Could you please help me know how eig(A), which is inbuild function of matlab, be replaced with Simulink block. Suggest any Tool if required.

2 views (last 30 days)
I am working on the project where we need to get the eigen values. Right now it has been implemented as function call shown below:
The requirement is to implement this code in Simulink design.
Could you please help me know how eig(A), which is inbuild function of matlab, be replaced with Simulink block. Suggest any Tool if required.

Answers (1)

Manish
Manish on 18 Oct 2024
Hi,
I understand that you want to implement ‘eig(A)’ in the Simulink.
In order to achieve this, you can use the ‘MATLAB Function’ block and write the desired code in it.
Here are the steps to implement:
  • Drag and drop the MATLAB Function block into your Simulink model from the Simulink Library Browser.
  • Inside the MATLAB Function block, write a user-defined function called ‘eigen(A)’. This function should calculate the eigenvalues and eigenvectors of the input matrix A using the ‘eig’ function in MATLAB.
  • Connect the input signals to the MATLAB Function block accordingly.
Here is the documentation link for ‘MATLAB Function’ block:
Hope this helps!

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!