How to save Char from Structure into Array MATLAB
17 次查看(过去 30 天)
显示 更早的评论
Hello, I hope you are doing well. I have the following Dataset which is basically in Structure form.
I want to save the ClassName array of two rows and one column using for loop
I have tried the following code But the codes does not work. Can any body help me with that
load ('Dataset.mat')
for i =1:length(Dataset)
ClassificationResult=Dataset(i).ClassName
OverallResult(i)=ClassificationResult;
end
0 个评论
回答(1 个)
Stephen23
2023-4-5
S = load('Dataset.mat');
D = S.Dataset
T = string({D.ClassName})
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!