Struct contents reference from a non-struct array object
Afficher commentaires plus anciens
%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 commentaire
Rik
le 11 Mai 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.
Réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!