How to load a specific element of a variable?

2 visualizaciones (últimos 30 días)
Paola
Paola el 6 de Feb. de 2018
Respondida: Walter Roberson el 6 de Feb. de 2018
Hello,
I have a file "Positions.mat" which contains 4 variables: a, b, c, d. Every variable is a 1x2 double.
For example:
a= 1 0.064293
b= 2 0.563890
c= 2 2.475530
d= 1 1.473709
If I load a variable I do
X= load('Positions.mat','a');
But how can I load only the second column of 'a'?
Thank you

Respuestas (1)

Walter Roberson
Walter Roberson el 6 de Feb. de 2018
If you save with the -v7.3 flag then you can do this using matFile()
I would suggest that this is much less efficient than regular access for small to moderate arrays.

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by