Tableからデータを抽出する方法
36 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Excelよりインポートした,Table型の変数について,指定した行・列にあるデータを取り出して計算に使いたいです.
また,一つのcellに保存されたスペース区切りの三つのデータを独立したデータもしくは行列として取り出したいです.
初歩的な質問で申し訳ございませんが,宜しくお願いいたします
0 commentaires
Réponse acceptée
Kenta
le 14 Jan 2020
clear;clc
T=readtable('Book1.xlsx');
vname=T.Properties.VariableNames;
filename=T{:,1};
Focal_length=T{:,2};
str2double(Focal_length{3})
center=T{:,3};
center_value=center{5};
center=split(center_value);
center1=str2double(center{1})
center2=str2double(center{2})
こんにちは、readtableでデータを読みだせます。
そして、上のように読み込めば、各値にアクセスできます。
center~のような、空白区切りの値については、splitという関数で分ければ、適宜読みだすことができます。
例として、はじめから3つ目まで読みだし方を書いています。それ以降も同様にできると思います。
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import from MATLAB 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!