Я пытаюсь сохранить матрицу из 2 столбцов с определенным именем файла, но продолжаю генерировать одно и то же сообщение об ошибке:
Error using save
Must be a string scalar or character vector
Мой код выглядит следующим образом:
CustomName = ['TheDataFrom','_', animalname, '-', animalnumber,'-',num2str(stimNumber), num2str(stimType), '.mat']); % the name I want the file to have, changes with different specimens
TheData(:,1) = codes(index,1);
TheData(:,2) = times(values,1)); %both of these vectors are the same length
save(CustomName, TheData);
Я также попытался превратить переменную 'TheData' в двойной вектор, сделав сначала TheData пустой матрицей, поэтому код выглядит так с дополнительной строкой:
CustomName = ['TheDataFrom','_', animalname, '-', animalnumber,'-',num2str(stimNumber), num2str(stimType), '.mat']); % the name I want the file to have, changes with different specimens
TheData = zeros(length(index), 2) %make a matrix of the right number of rows and columns, comes out as class 'double'
TheData(:,1) = codes(index,1); %put data into each column
TheData(:,2) = times(values,1));
save(CustomName, TheData);
Я просто хочу сохранить эту матрицу симя конкретного образца, у меня нет идей, почему то, что я делаю, не работает.Пожалуйста, помогите!
Спасибо