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 Comment

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.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2017a

Asked:

on 11 May 2018

Commented:

Rik
on 11 May 2018

Community Treasure Hunt

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

Start Hunting!