How to show mat file to struct ?

47 vues (au cours des 30 derniers jours)
Chidiebere Ike
Chidiebere Ike le 26 Avr 2019
Commenté : Star Strider le 27 Avr 2019
Hello, I wish to know how to show data in .mat file in the form struct and save it back to mat file format?

Réponse acceptée

Star Strider
Star Strider le 26 Avr 2019
If you load the .mat file to a variable, it will automatically be a structure:
Data = load('yourMatFile.mat');
You can then access the variables in the file as:
x = Data.Variable1;
y = Data.Variable2;
and so forth, depending on the variable names in the .mat file.
See the documentation section on: Load List of Variables Into Structure Array (link) for an extended discussion.
  4 commentaires
Chidiebere Ike
Chidiebere Ike le 27 Avr 2019
Thanks, I appreciate
Star Strider
Star Strider le 27 Avr 2019
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by