multiply large numeric two array and convert that array in Binary

2 ビュー (過去 30 日間)
stuti
stuti 2018 年 7 月 25 日
コメント済み: Walter Roberson 2018 年 8 月 4 日
fileId=fopen('sinlookup.txt','r');
line_num=0;
lineData='0';
while ~feof(fileId)
line_num=line_num+1;
lineData=fgetl(fileId);
disp(['Line ',num2str(line_num) , ': ' lineData ]);
end
  13 件のコメント
stuti
stuti 2018 年 8 月 2 日
array1 = [0.1 -0.2 0.3 -0.4].';
array2 = 1:12;
array3=0;
n_array2 = (array2).';
b = repmat(array1,[3 1]);
array3 = array3 + b * n_array2
Thank you this work perfectly.
I want help in further, how to convert this floating point number array into 32bit binary.
Walter Roberson
Walter Roberson 2018 年 8 月 2 日
You have two arrays of different lengths, just like this small example has two arrays of different lengths. How would you like the two to be multiplied? Use the short example to illustrate the result you would want.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 8 月 2 日
I think you want to do filtering, which could be done by conv()
  2 件のコメント
stuti
stuti 2018 年 8 月 4 日
hello sir, i have array of 65535*1 and my second array is 400*1.
a = repmat(A{:,1},164,1)
i am using this syntax repeat my this(400*1) array in to 164 times then it become (65600*1). ( 65535*1 ) this value is not multiple of 400 so what i do. cause this is the reading of signal which i stored in the buffer and for multiplication the size of array should be same. any other way to do this type of multiplication.
Walter Roberson
Walter Roberson 2018 年 8 月 4 日
I would buffer(LargeArray, 400) which would create a 400 x 165 array. Then you can multiply it column by column by your 400 array. If you have R2016b or later, that would look like
output = buffer(LargeArray, length(SmallerArray)) .* SmallerArray(:);
This would produce a 400 x 165 array which you could reshape into a vector if you wanted to.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by