[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52854] matintrlv.m doesn't work with matrices
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #52854] matintrlv.m doesn't work with matrices + fix |
Date: |
Wed, 10 Jan 2018 03:13:38 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?52854>
Summary: matintrlv.m doesn't work with matrices + fix
Project: GNU Octave
Submitted by: None
Submitted on: Wed 10 Jan 2018 08:13:37 AM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Mike Miller
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 4.2.1
Operating System: Microsoft Windows
_______________________________________________________
Details:
The current implementation of matintrlv produces an error for matrices with
the number of rows equal to nrows*ncols, even though it should work.
The error message "DATA must have NCOLS*NROWS rows" is given.
To fix this issue, one can simply replace line 46 of the original code.
Original code: if (length (data) != Nrows*Ncols)
Fixed code: if (length (data(:,k)) != Nrows*Ncols)
The bug can easily be reproduced by:
matrix = ones(4,6);
matintrlv(matrix,2,2);
The erroneous behaviour is caused by the wrong if statement. Matintrlv should
work column-wise for matrices, but the if statement looks at the whole matrix
instead of the current column, which produces an error message and the code
execution is stopped.
The rest of the code works just fine.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52854>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52854] matintrlv.m doesn't work with matrices + fix,
anonymous <=