Effacer les filtres
Effacer les filtres

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

12 vues (au cours des 30 derniers jours)
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,

Réponse acceptée

DGM
DGM le 27 Mar 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));

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by