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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:19:17+00:00 2026-06-17T21:19:17+00:00

i am attempting to debug a part of the code but getting this error:

  • 0

i am attempting to debug a part of the code but getting this error:

??? Error using ==> plus

Matrix dimensions must agree.

Error in ==> dwtembed at 48
cH1=cH1+k*pn_sequence_h;

This is the code segment:

for kk=1:length(message_vector)  
pn_sequence_h=round(2*(rand(Mc/2,Nc/2)-0.5)); 
pn_sequence_v=round(2*(rand(Mc/2,Nc/2)-0.5)); 
if (message(kk) == 0) 
    cH1=cH1+k*pn_sequence_h; 
    cV1=cV1+k*pn_sequence_v; 
end 
end 

These are the values for the variables:

kk 18096  
message_vector <150096x1 double>  
pn_sequence_h <118x116 double>  
Mc 236  
Nc 232  
pn_sequence_v <118x116 double>  
cH1 <118x116x3 double>  
cV1 <118x116x3 double>  
k   2

Can you please help me out with the information provided.

  • 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-17T21:19:19+00:00Added an answer on June 17, 2026 at 9:19 pm

    You have mismatch dimensions. You are trying to add CH1 of size 118x116x3 (a 3D array) with on_sequence_h which is 118×116 (a 2D matrix). This operation is not defined

    You may use bsxfun:

    cH1 = bsxfun( @plus, cH1, k*pn_sequence_h ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Curious as to why I'm getting this error when attempting to debug my program
I am attempting to debug some C code using the visual studio debugger. I
I get this error when attempting to debug my form, I cannot see where
I've been attempting to debug this all morning but can't seem to find the
I have been attempting to debug my program, but it always seems to get
I'm attempting to debug a grails application and when I change controller code (method
I'm receiving a rather cryptic error when attempting to debug a simple C++ application.
I am attempting to use GDB to debug a Stellaris LM3S8962 Evaluation board using
I am attempting to debug a program in VS2010 using a breakpoint with a
I want to prevent VS from attempting to debug code that is not mine.

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.