简体   繁体   English

在C ++中读取八度二进制文件

[英]Reading an octave binary file in C++

I have a binary file, created by Octave containing the values of variables, is there a way to read them into a c++ program so that the values can be used by a c++ class? 我有一个由Octave创建的二进制文件,其中包含变量的值,有没有办法将它们读入c ++程序,以便c ++类可以使用这些值?

Going through an Octave script is acceptable. 接受Octave脚本是可以接受的。

The file is created with the command: 使用以下命令创建文件:

save("-binary",fileName,myMatrix,"var1","var2");

If you program is licensed under the GPL you can use liboctave/libinterp and link your C++ program against it. 如果您的程序是根据GPL许可的,则可以使用liboctave / libinterp并将其链接到C ++程序。 See libinterp/corefcn/load-save.cc 参见libinterp / corefcn / load-save.cc

http://wiki.octave.org/FAQ#I_wrote_a_program_that_links_with_Octave_libraries_and_I_don.27t_want_to_release_it_under_the_terms_of_the_GPL._Will_you_change_the_license_of_the_Octave_libraries_for_me.3F http://wiki.octave.org/FAQ#I_wrote_a_program_that_links_with_Octave_libraries_and_I_don.27t_want_to_release_it_under_the_terms_of_the_GPL._Will_you_change_the_license_of_the_Octave_libraries_for_me3。

See https://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html howto write standalone programs which use octave. 请参阅https://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html如何编写使用八度的独立程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM