필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Datatype problem with arduino and coder.ceval

조회 수: 1 (최근 30일)
Marcell
Marcell 2015년 1월 30일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello, I'm writing a simulink device driver block for Arduino Due with the Matlab Function Approach as explained in the Simulink Device Driver guide. When I want to pass a double from the C++ code to the matlab function code with coder.ceval() I get a wrong number. Here is an example:
C++ function:
#include <Arduino.h>
extern "C" double dout_output()
{
return 50.5;
}
Matlab function in Simulink:
function x = example()
x = 0.0;
if strcmp(coder.target,'rtw'),
x = coder.ceval('dout_output');
end
When I run this code in external mode on an adruino due I don't get the 50.5 but a large number like 1113794816. Any sugestions?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by