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!