Load an array instead of a struct with fields

43 vues (au cours des 30 derniers jours)
Jacob Anderson
Jacob Anderson le 7 Août 2022
Modifié(e) : Bruno Luong le 7 Août 2022
I'm having an annoying problem where I create an array and save it to a .mat file, but when I load it, it is now converted to a "struct with fields" format which I then cannot seam to be able to access the values of. Why does it convert it? How do I get it to just plain leave it as an array!?

Réponse acceptée

Bruno Luong
Bruno Luong le 7 Août 2022
Modifié(e) : Bruno Luong le 7 Août 2022
Do this when loading,
Container = load('Saving.mat');
Saving = Container.Saving;
Check out doc of save ans struct so you won't be stuck for basic data manipulation syntax.
"Why does it convert it?"
Because you tell MATLAB doing so with your command
Saving = load('Saving.mat');

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by