필터 지우기
필터 지우기

how to initialize a mwArray

조회 수: 5 (최근 30일)
Kaushik
Kaushik 2012년 10월 17일
답변: a tabatabaei 2015년 9월 15일
hi,
in c++ i create an array
double c_arr_a[14];
then i put values in it
for(i=0;i<14;i++)
{
c_arr_a[i] = 0.5;
}
then i create a matlab mwArr
mwArray matlabArr(14 , 1, c_arr_a);
and i get an error. Is this not a valid mwArray initilization ?

답변 (1개)

a tabatabaei
a tabatabaei 2015년 9월 15일
mwArray constructor gives number of rows in the first parameter and number of columns in the second parameter. You should use:
mwArray matlabArr(1 , 14, c_arr_a);

카테고리

Help CenterFile Exchange에서 Deploy to C++ Applications Using mwArray API (C++03)에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by