how to find number of bytes in a row of a matrix

2 次查看(过去 30 天)
I have a matrix with 4431 rows and 102 columns. Each column is of different length(1st column is 4 bytes and precision is unsigned integer32, 2nd column is 2 bytes and precision is unsigned inter 16 etc) Total bytes in a row is 5822. how to read from a specific byte in a row?

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-4-30
Look at this example
a=num2cell(uint16(randi(4,1,4)))
b=num2cell(uint32(randi(4,1,4)))
c=[a b]
d=c(randperm(8))
% d is a cell array containing uint32 and uint16 numbers
idx=cellfun(@(x) isequal(class(x),'uint32'),d) % Find indices of uint32 numbers
out=d(idx)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by