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 7646477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:13:06+00:00 2026-05-31T10:13:06+00:00

I am getting output of reshape function as follow s1 = 11 00 10

  • 0

I am getting output of reshape function as follow

s1 =

11 
00 
10 
11 
01 
11 
10 
10 
10 
10 
10 
10 
10 
01 
10 
01

How to convert s1 as

[1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 0 0 1] 

so i can pick up bit values
s1(1) will be 1
s1(3) will be 0
s1(5) will be 1

I have tried it with reshape and transpose but not picking up correct bit values. Appreciate any help..


I am doing following operation with below code

converting cipher text to bytes, then I am calculating index variable (called as p) & formula is MOD(No of Bytes,3).. I have ciphertext length as 5 bytes so Index Variable (p) is 2.. I will always have index varaible values as 0 or 1 or 2 which will be based on no. of Bytes

Say ciphertext is 11001011 01111010 10101010 10011001 01010101

This data is five bytes there for inde variable is 2

11001011 01111010 10101010 10011001 01010101

Now
for first two bits (11) , index variable to be assigned as 2
for next two bits (00), index variable to be assigned as 0
for next two bits (10), index variable to be assigned as 1
for next two bits (11), index variable to be assigned as 2..so on till end of my bits.


Other Example
Ciphertet with Three Bytes 11001011 01111010 10101010
Index Variable (p) will be 0

for first two bits (11) , index variable to be assigned as 0
for next two bits (00), index variable to be assigned as 1
for next two bits (10), index variable to be assigned as 2
for next two bits (11), index variable to be assigned as 0..
so on till end of my bits..

s = '11001011 01111010 10101010 10011001 01010101'
p = rem(numel(regexp(s,' [01]'))+1,3)
k = (0:2)'
s1 = reshape(regexprep(s,' ',''),2,[])'
n = size(s1,1)
N = k(:,ones(fix((n+1)/3)+1,1))
P = N(find(N(:,1) == p)+(0:n-1))'
  • 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-05-31T10:13:08+00:00Added an answer on May 31, 2026 at 10:13 am

    Well s1' will give you

    [11 00 10 11 ...]
    

    but if you show us the input to your function I might be able to give you the answer you really want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building this function but I'm not getting the desired output, it's been more
i am using ExecuteOracleNonQuery and getting rowid as output parameter.How can i optimize subsequent
I'm having trouble finding/getting any logging output from a web service. I have a
I am trying to use simple split() method but the output I am getting
Here i wrote some code but not getting output.. Please tell me why is
I'm using Stroustrup's swan book. I have run into a problem getting output from
Getting output with Java is pretty easy as you can make use of System.out.print
In below program i am getting output as false .But as per my understanding
render:function(output){ _.each(output, function(i){ p=i.name; }); $(this.el).append(p); } here i am getting output in the
for some reason I'm having trouble getting output with this form.. I have a

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.