How do read .npy files in matlab?

1,214 ビュー (過去 30 日間)
Juan Pablo Restrepo Uribe
Juan Pablo Restrepo Uribe 2019 年 2 月 14 日
回答済み: Grace Kepler 2023 年 11 月 7 日
Hello.
In matlab it is possible to read the extension .npy, or in its absence the extension .LVM of Labview.

採用された回答

Andrew Knyazev
Andrew Knyazev 2019 年 6 月 11 日
https://github.com/kwikteam/npy-matlab
  5 件のコメント
Maria Jose Palancares Sosa
Maria Jose Palancares Sosa 2021 年 7 月 14 日
Super useful, thanks!
Svetlana Piner
Svetlana Piner 2022 年 3 月 18 日
Best response from my point of view!

サインインしてコメントする。

その他の回答 (4 件)

Toon Weyens
Toon Weyens 2021 年 2 月 16 日
If you have access to Python, the easiest thing would be to create a Python script such as the one below, and run that. It will find all .npz files in the current directory and convert that to .mat.
from scipy.io import savemat
import numpy as np
import glob
import os
npzFiles = glob.glob("*.npz")
for f in npzFiles:
fm = os.path.splitext(f)[0]+'.mat'
d = np.load(f)
savemat(fm, d)
print('generated ', fm, 'from', f)
  5 件のコメント
Grzegorz Klosowski
Grzegorz Klosowski 2022 年 9 月 8 日
Good job. Thanks.
Mark Sie
Mark Sie 2023 年 6 月 18 日
Help me greatly thank u

サインインしてコメントする。


Cam Salzberger
Cam Salzberger 2019 年 2 月 14 日
Hello Juan,
I don't believe that either of those file formats are natively supported in MATLAB, but you can always check File Exchange to see if anyone has written an importer for them. A quick search did not turn up anything for NPY, but LVM turned up this one. If you have any questions about that File Exchange package, it's best to direct them to the author of the package.
-Cam
  1 件のコメント
Johann Martinez
Johann Martinez 2022 年 2 月 23 日
One more reason to stop using Matlab. Python indeed has libraries to make use Matlab.

サインインしてコメントする。


ROuntrance Krumph
ROuntrance Krumph 2022 年 11 月 11 日
You cannot do so. MATLab® is proprietary software and cannot run "open-source" code .
It shall be destined to go the way of the Pheonix (Arizona)
size(IRIS); IRIS(size)
Unrecognized function or variable 'IRIS'.

Grace Kepler
Grace Kepler 2023 年 11 月 7 日
Yes, use code like this.
>> x=py.numpy.load('data.npy')

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by