Getting "Execution of script feature as a function is not supported "
Show older comments
For the below code I got an error as execution of script feature as a function is not supported. Could anyone please help me to get out from this error. My code is
function [dataset,classes ] = load_dataset(file_name)
dataset = readtable(filename,'TextType','string');
classes = "Result";
dataset= convertvars(dataset,classes,'categorical');
if ~isempty(dataset)
disp('Dataset has been loaded')
end
6 Comments
Cris LaPierre
on 31 May 2022
I inserted line feeds to make it easier to read the code withough having to scroll
Kaviya Meena
on 31 May 2022
Walter Roberson
on 31 May 2022
That's fine but the problem is the extra feature.m that you have.
Kaviya Meena
on 31 May 2022
Walter Roberson
on 31 May 2022
yes, I guarantee you that is the cause of the problem.
Accepted Answer
More Answers (1)
vasanthkumar
on 21 Feb 2023
0 votes

Hi, i am using MATLAB 2022b offline i am facing this issue as file attached below , please help me out.
Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!