getting different results for subtraction

I'm new to matlab , and caught at a point where i can't understand things. actually i have 2 files, one binary file and one csv file. I'm writting data as float in c++ in vitis hls in that binary file and i'm writting data as float32 in jupyter lab in python and uploaded these files to matlab and attempt to get difference but, i am getting diff results when i check the difference values again n again and my matlab code is below:
clc, clear all;
beamformed_data = readmatrix('delay1024.csv');
filename = 'dec15_CFB_hls_ver2.bin';
fid = fopen(filename,'rb');
if fid == -1
error('Error opening file');
end
% Read the binary data into a 1D array
%data = fread(fid, inf, 'float');
data = fread(fid,'float');
% Reshape the 1D array into a 2D array
beamformed_data2 = reshape(data, 1024, 33);
difference = (beamformed_data2 - beamformed_data) ;
can i be guided somehow?

댓글 수: 1

Steven Lord
Steven Lord 2024년 12월 17일
Please attach your delay1024.csv and dec15_CFB_hls_ver2.bin files.
Also please describe the magnitude of values you're seeing in the difference variable. Are the differences large or are they on the order of roundoff error (eps(beamformed_data))?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

질문:

2024년 12월 17일

댓글:

2024년 12월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by