Skip to content

Conversation

songjhaha
Copy link
Contributor

@songjhaha songjhaha commented Mar 7, 2025

we have some old mat file,but the name is store without null-terminator '\0'(it could be create from some old c program).

MATLAB and scipy is compat with these file.

here is a test .m script to generate example mat file:

fid = fopen('testnamelen_4.2c_SOL2.mat', 'wb')
data = rand(1,9);
[M, N] = size(data);
data_type = 0;
prec = 'double';
name = 'testnamelen';

L = length(name);

fwrite(fid, data_type, 'int32');

fwrite(fid, M, 'int32');

fwrite(fid, N, 'int32');
fwrite(fid, 0, 'int32');
fwrite(fid, L, 'int32');
fwrite(fid, name, 'uint8');
fwrite(fid, data, prec);

data1 = load('testnamelen_4.2c_SOL2.mat');

assert(all(data1.(name)==data))

@songjhaha
Copy link
Contributor Author

@ViralBShah could you review this PR?

@ViralBShah
Copy link
Contributor

I do not know this package well enough to review - but it would be great for some of the new PR authors to come together to maintain the package.

@ViralBShah
Copy link
Contributor

ViralBShah commented Aug 19, 2025

Actually this looks straightforward enough. Should a test be added to actually test the added file?

@songjhaha songjhaha force-pushed the sjh/mat-v4-namelen branch 3 times, most recently from 5bc3647 to 7a3c235 Compare August 20, 2025 01:27
@songjhaha
Copy link
Contributor Author

Tests have been added.

@ViralBShah ViralBShah merged commit 2df47dd into JuliaIO:master Aug 20, 2025
8 checks passed
@ViralBShah
Copy link
Contributor

Happy to give you commit access if you can tag and release a new version etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants