How do read .npy files in matlab?

조회 수: 1,126 (최근 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 CenterFile Exchange에서 Call 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