Thu 21 May 2015 12:14:54 AM UTC, comment #2:
I'm having trouble compiling (library issues... on a new computer)
Here's the fix I propose, which is kindof a hack but I don't see it causing any issues
colin@euler:octave$ hg diff
diff -r abf85f8cbd6c libinterp/corefcn/dlmread.cc
--- a/libinterp/corefcn/dlmread.cc Wed May 20 08:01:10 2015 -0700
+++ b/libinterp/corefcn/dlmread.cc Wed May 20 19:12:32 2015 -0500
@@ -474,16 +474,19 @@
if (c1 >= c)
c1 = c - 1;
- // Now take the subset of the matrix.
- if (iscmplx)
- cdata = cdata.extract (0, c0, r1, c1);
- else
- rdata = rdata.extract (0, c0, r1, c1);
+ // Now take the subset of the matrix, if we have at least one value
+ if (i > 0 || j > 0)
+ {
+ if (iscmplx)
+ cdata = cdata.extract (0, c0, r1, c1);
+ else
+ rdata = rdata.extract (0, c0, r1, c1);
- if (iscmplx)
- retval(0) = cdata;
- else
- retval(0) = rdata;
+ if (iscmplx)
+ retval(0) = cdata;
+ else
+ retval(0) = rdata;
+ }
}
return retval;
|
Wed 20 May 2015 11:27:31 PM UTC, original submission:
When running csvread on an empty file (created by `touch ~/empty.csv`) the dlmread function returns with an error.
I am not sure how MATLAB responds to this, but I would expect proper functionality would be to return an empty matrix.
I have created a patch for this and will include it in my next post. I'm currently pulling the updated source and, after verifying, will submit it.
|