在我的代碼中,我更改了數組(int *),然後我想將它與matlab結果進行比較。將C++數組轉換爲matlab使用文件的大矩陣
因爲我的數組是1200×1000的元素。這需要永遠將其加載到MATLAB
我試圖複製打印輸出文件到MATLAB命令行...
for (int i = 0; i < _roiY1; i++)
{
for (int j = 0; j < newWidth; j++)
{
channel_gr[i*newWidth + j] = clipLevel;
}
}
ofstream myfile;
myfile.open("C:\\Users\\gdarmon\\Desktop\\OpenCVcliptop.txt");
for (int i = 0; i < newHeight ; i++)
{
for (int j = 0; j < newWidth; j++)
{
myfile << channel_gr[i * newWidth + j] << ", ";
}
myfile<<";" <<endl;
}
有創建從C可讀矩陣數據更快的方法+ +?進入matlab?