Why do I get the error "Unrecognized function or variable"?
Show older comments
I have the error "Unrecognized function or variable 'HW1'." in the following code:
close all
clear all
%Question 2
dataStringArray = readtable('bank.csv');
%Question3
dataTable = readtable('bank.csv');
%Question4
age = dataTable.age(155);
education = dataTable.education{155};
%Question5
dataNumericMatrix = readmatrix('bank.csv');
%Question 6
dataCellArray = readcell('bank.csv');
%Question 7
elementRow100Col4 = dataNumericMatrix(100, 4);
allElementsRow250 = dataCellArray(250, :);
The bank.csv document is in the same file than my code. My code is saved under the name "HW1.m". I don't understand why I keep having this error message in my code. If someone could help it would be nice.
Answers (1)
Star Strider
on 21 Jan 2024
0 votes
The important information is likely not shown here. My guess is that you are referring to ‘HW1’ somewhere else (perhaps in another script), and that is throwing the error. It might be necessary for you to replace the isolated reference to ‘HW1’ with:
run('HW1')
or:
run('HW1.m')
.
Categories
Find more on Standard File Formats 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!