I want to transform Matlab code to arduino code, How could I do it? thanks
조회 수: 1 (최근 30일)
이전 댓글 표시
Mi code is :
function [SaT,SaB,SbT,SbB,ScT,ScB] = fcn(u)
Ts= 0.0002;
Vdc=300;
a= u(1)/((2/3)*Vdc); % u(1) magnitud
x=u(2)*(180/pi) % u(2) angulo
u(3)
if (x>=0) && (x<(60)) k=1 Ta = ((a*Ts)/sind(60))*sind((k*60)-x)
Tb = ((a*Ts)/sind(-60))*sind(((k-1)*60)-x)
To = Ts-Ta-Tb
T1=To/4;
T2= T1+(Ta/2);
T3= T2+(Tb/2);
T4= T3+(To/2);
T5= T4+(Tb/2);
T6= T5+(Ta/2);
T7= T6+(To/4);
댓글 수: 0
답변 (1개)
jpai
2017년 6월 28일
편집: jpai
2017년 6월 28일
If you would like to use MATLAB code to program an Arduino, one thing you could try would be the MATLAB Support Package for Arduino Hardware. The documentation related to getting started with the package can be found in the following link: http://www.mathworks.com/help/supportpkg/arduinoio/. This should allow you to directly program the Arduino via MATLAB without needing to convert the code.
If you would like to know more about what versions of MATLAB support this package, the answer found in the following link should provide that information: https://www.mathworks.com/matlabcentral/answers/242924-arduino-support-from-matlab-and-simulink-across-releases.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!