×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Comparing matrices with different length

Comparing matrices with different length

Comparing matrices with different length

(OP)
Hi there,

I need your help with the following task.
I am trying to compare the two following matrices with each other
A=[8 8 8 8 %month
1 1 1 1 %day
1 2 4 5 %hour
1 2 3 4] %values

B=[8 8 8 8 8 %month
1 1 1 1 1 %day
1 2 3 4 5] %hour

Of course there are not only gaps in the hourly row but also in the daily row.

The resulting matrix should look like that
C=[8 8 8 8 8
1 1 1 1 1
1 2 3 4 5
1 2 NaN 3 4]

The script should check which dates are equal in the matrices A and B and also write the values which I have in the Matrix B and a NaN value in Matrix B if there is a gap.

Thanks in advance for your help!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources