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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:11:40+00:00 2026-06-10T21:11:40+00:00

In GNU Octave, How does matrix division work? Instead of doing 1./[1;1] I accidentally

  • 0

In GNU Octave, How does matrix division work?

Instead of doing

1./[1;1]

I accidentally did

1/[1;1]

To my surprise this yields:

[0.5, 0.5]

The transverse case:

1/[1,1]

gives the expected:

error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)

Can someone explain the [0.5, 0.5] result?

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

    this is a answer i got from Alan Boulton at the coursera machine learning course discussion forum:

    The gist of the idea is that x / y is defined quite generally so that it can deal with matrices. Conceptually the / operator is trying to return x∗y−1 (or x * inv(y) in Octave-speak), as in the following example:

    octave:1> eye(2)/[1 2;3 4]
    ans =
      -2.00000   1.00000
       1.50000  -0.50000
    
    octave:2> inv([1 2;3 4])
    ans =
      -2.00000   1.00000
       1.50000  -0.50000
    

    The trickiness happens when y is a column vector, in which case the inv(y) is undefined, so pinv(y), the psuedoinverse of y, is used.

    octave:1> pinv([1;2])
    ans =
       0.20000   0.40000
    
    octave:2> 1/[1;2]
    ans =
       0.20000   0.40000
    

    The vector y needs to be compatible with x so that x * pinv(y) is well-defined. So it’s ok if y is a row vector, so long as x is compatible. See the following Octave session for illustration:

    octave:18> pinv([1 2])
    ans =
       0.20000
       0.40000
    
    octave:19> 1/[1 2]
    error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)
    octave:19> eye(2)/[1 2]
    ans =
       0.20000
       0.40000
    
    octave:20> eye(2)/[1;2]
    error: operator /: nonconformant arguments (op1 is 2x2, op2 is 2x1)
    octave:20> 1/[1;2]
    ans =
       0.20000   0.40000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a function in GNU Octave that does bilinear interpolation on
In GNU Octave, I'm getting an error with this code. A = cell(10,1); A{5,1}
In Matlab or GNU Octave I'd like to do something like this: x=struct('a',1,'b',2,'c',[1 2;3
In GNU Octave version 3.4.3 I want to round a matrix to 2 units
GNU bash, version 4.1.5(1)-release-(i486-pc-linux-gnu) Ubuntu Linux 10.04 This prints var as 1234 and does
The GNU case range extension allows case ranges in switch statements: switch (value) {
(this is similar to GNU make: Execute target but take dependency from file but
I'm using gnu as for a simple boot. It's something like this: .text .org
I recently downloaded the latest stable release of Gnu Octave, and was attempting to
uniq (GNU coreutils 8.5) does not seem to distinguish between em- and en-dashes: $

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.