how to load a matrix into the workspace and save the value of a cell into a float variable

12 visualizaciones (últimos 30 días)
Hi,
I have a matrix, called 1.mat, that I would like to load into the workspace and then save the cell (2,4) (line 2 and column 4) into the float variable var1. How can I do it? I thank you in advance,
Best regards,

Respuesta aceptada

DGM
DGM el 27 de Mzo. de 2021
A .mat file may contain multiple objects. Nobody can guess what's in your .mat file.
For the sake of demonstration, I'll assume your .mat file contains a hypothetical numeric array called 'myarray'.
load(1.mat);
var1=double(myarray(2,4));

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by