Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:37:21+00:00 2026-06-17T09:37:21+00:00

I have a binary Band Sequential (1-band, BSQ file), which is an unsigned 16-bit

  • 0

I have a binary Band Sequential (1-band, BSQ file), which is an unsigned 16-bit (2-byte) integer.

Currently I’m reading the whole (image) through multibandread:

img=multibandread('IMAGE.bsq',[400 400 1],'uint16',0,'bsq','n');

What process in MATLAB would allow me to read both bytes individually? i.e. I would like to read the file into 2 new arrays in MATLAB e.g. byte1 (400x400x1) and byte2 (400x400x1).

Can this be achieved through fread? I note in the ‘precision’ section it is possible to skip source values (e.g. 'N*source=>output'), but I’m unsure of the exact process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:37:22+00:00Added an answer on June 17, 2026 at 9:37 am

    One way would be splitting your current img with bitwise operations. The LSB image would be:

    img1 = bitand(img, 255);   %// 0x00FF
    

    and the MSB image would be:

    img2 = bitsra(img, 8);
    

    Not mandatory, but maybe you’ll also want to convert these into uint8s:

    img1 = uint8(img1);
    img2 = uint8(img2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have binary data in a file (a list of 32-bit integer values) that
I have a binary file, that was written in C, which contains a long
i have a binary file which has 4 KB of header information and then
I have binary data in a file that I can read into a byte
I have binary files which contain each one PNG file at a time (the
I have binary data in a byte sequence described by const unsigned char *p
I have a binary image that represents a number in MATLAB: I'd like to
I have a binary file that contains blocks of information ( I'll refer to
I have a binary search loop which gets hit many times in the execution
I've got a strange problem in writing/reading binary values: bool readHeader(std::fstream &file) { file.seekg(0);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.