'Syms' in Simulink implementation (Symbolic variables)
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am working with the Matlab function block in Simulink where I give it 6 inputs and I am trying to get 2 outputs.
The problem comes when using 'syms' for symbolic variables. I get the error Function 'syms' not supported for code generation. When running my simulink model.
Below is an example of the matlab script that I'm trying to integrate to simulink. The code is really simple it is just trying to solve two circunference equatios for 'x' and 'y' using the inputs provided to the simulink block
function [X,Y]= fcn(Data1, Data2, Data3, Data4, Data5, Data6)
syms x y
vars = [x y];
h1=Data1;
k1=Data2;
r1=Data3;
h2=Data4;
k2=Data5;
r2=Data6;
eqns = [(x-h1).^2 + (y-k1).^2 == r1,... % circumference equation 1
(x-h2).^2 + (y-k2).^2 == r2]; % circumference equation 2
[solx, soly] = solve(eqns, vars);
X= solx;
Y= soly;
end
Is there a way of implementing 'syms' in simulink or any other alternative? I have read something about the coder.extrinsic function for matlab but I am not sure about how to use it as I have a different number of outputs and inputs.
1 commentaire
Niraj Reginald
le 18 Nov 2019
Hi Lenin,
Were you able to solve this? I am facing the same issue?
Thank you,
Niraj
Réponses (0)
Voir également
Catégories
En savoir plus sur Simulink Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!