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 comentario

Rik
Rik el 11 de Mayo de 2018
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2017a

Preguntada:

el 11 de Mayo de 2018

Comentada:

Rik
el 11 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by