フィルターのクリア

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

12 ビュー (過去 30 日間)
Hugo
Hugo 2021 年 3 月 27 日
回答済み: DGM 2021 年 3 月 27 日
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,

採用された回答

DGM
DGM 2021 年 3 月 27 日
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));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by