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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:07:52+00:00 2026-05-26T16:07:52+00:00

Let us assume there is a matrix [mXn]. for example: a=[2 9; 5 7;

  • 0

Let us assume there is a matrix [mXn]. for example: a=[2 9; 5 7; 8 25; 1 6; 3 9].

I would like to know how to subtract 1st row from 2nd row and so on till end where the difference between two row is 1.

Next subtract first row from 3rd row and so on where the difference is 2.

And after each loop save the output of the new matrix with a name respective to the loop say for difference1 name may be as newMatDif_1 and so one.

diff1----5-2 7-9; 8-2 25-9; .......newMatDiff_1  
diff2----8-2 25-9; 3-8  9-25;.......newMatDiff_2    
diff3----1-2 6-9; .......newMatDiff_3
  • 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-26T16:07:53+00:00Added an answer on May 26, 2026 at 4:07 pm

    Your naming scheme is not really feasible or useful in MATLAB, so I’ve used a 3-dimensional array to hold the differences. The key to this operation is rotating the rows of the array, for which I’ve defined a function:

    rotate_rows = @(A, n) ( [ A((n+1):end,:); A(1:n,:)]);
    
    for r = 1:rows(A)-1
        diffs(:,:,r) = a - rotate_rows(a,r);
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the example I'm looking to create... Let's assume there are two divs,
Let's assume there are 2 applications. The POM hierarchy might look like this: parent
Firstly, let me set out what I'd like to do. Assume I have three
Let's assume there's a class with a virtual property (let's call it 'P'). It's
let's assume there is a site http:/ /testsite.com , with some filds and submit
Let's assume that we have a simple matrix 3rows x 7cols. The matrix includes
Let's assume there is a client that makes a lot of short-living connections to
I have a mysql database that stores some timestamps. Let's assume that all there
Let's assume there are four files: foo.h, foo.cpp, bar.h, bar.cpp. foo.h: #pragma once class
let's assume I have a so called 2.0 app, compatible from IE6 upwards. The

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.