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

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에 대해 자세히 알아보기

제품

릴리스

R2017a

질문:

2018년 5월 11일

댓글:

Rik
2018년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by