Struct contents reference from a non-struct array object
显示 更早的评论
%MATLAB SCRIPT
clearvars;
rng(1);
%1. PRELIMINARIES
% Add a path to the HMSC directory
addpath ('U:\MATLAB\HMSC-Matlab\HMSC class2');
% Assign the folder containing the simulated data
dataFolder = 'U:\MATLAB\HMSC-Matlab\data2\simulated3';
% Assign the folder where the results for this model will be saved (under
% the results subfolder to be generated by HMSC)
folder = 'U:\MATLAB\resultados2';
%2.READING IN THE DATA
file1 = fullfile(dataFolder, 'presabs1_Copy.csv');
Yda1 = importdata(file1);
Y = Yda1.data;
species1 = Yda1.textdata;
1 个评论
Rik
2018-5-11
The problem occurs in the final part: importdata should load you csv file to a struct with one or more of these fields: data, textdata, colheaders, rowheaders. I would recommend using a more low-level approach and load the file with dlmread or textscan instead, and apply the necessary post-processing yourself.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!