Show older comments
matlab で作成した、20000行×3列のtable配列をA.matで保存しました。
A.matを読み出し、20000行×3列のtable形式で利用したいと思っています。
①load(A.mat)とすると、table形式ではなくstructの形式で呼び出されてしまう。
loadの使用方法が間違っているか、別の関数を使うべきか。
②struct形式で呼び出してしまったため、struct2tableを使用して、table形式に変更したところ20000行×1列になってしまう。
原因がわからないため、理由を教えてほしいです。
よろしくお願いいたします。
Accepted Answer
More Answers (1)
Hernia Baby
on 8 Mar 2022
もしかしたら保存部分でひっかかってるかもしれません。
例えばほかの変数も保存している等が考えられます。
save はどのようになっていますでしょうか?
------
以下、table型で読み込まれていることを確認できるサンプルです。
サンプルを作ります
clc,clear,close all;
LastName = {'Sanchez';'Johnson';'Li';'Diaz';'Brown'};
Age = [38;43;38;40;49];
Smoker = logical([1;0;1;0;1]);
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
tableを作り、保存します
T = table(LastName,Age,Smoker,Height,Weight,BloodPressure)
save("test.mat","T")
ワークスペースをすべて消去し、呼び出します
clear
load("test.mat")
Categories
Find more on table in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!