How to convert an m-file which works offline to real-time operation?
조회 수: 2 (최근 30일)
이전 댓글 표시
Prajwal Ramakrishna
2018년 1월 4일
답변: Emmanouil Tzorakoleftherakis
2018년 1월 8일
I have a MATLAB script which extracts the logged data from excel spreadsheet, processes it according to if/else loops, performs calculations and generates the result. Now, I have a serial output (in ASCII format) from a CAN-Interface which gives real-time (live) data from the vehicle.
Would it be possible to use this real-time data (similar data as that of the logged Excel sheet data) as a continuous input to the already existing MATLAB script so that it generates results real-time? If so, what are the main commands I should consider and modifications in the MATLAB script? Is it advisable to use Simulink so that I can use the code as a MATLAB function block and build the other blocks for execution?
댓글 수: 0
채택된 답변
Emmanouil Tzorakoleftherakis
2018년 1월 8일
Hi Prajwal,
You should be able to achieve the desired behavior using the MATLAB Fcn block. To do that, you should modify your MATLAB script to be code-gen compatible since a mex file will be generated for the MATLAB Fcn block when you run your model.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!