Why do I get the error "Unrecognized function or variable"?

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.

Antworten (1)

Star Strider
Star Strider am 21 Jan. 2024

0 Stimmen

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')
See the documentation on run for details.
.

Kategorien

Gefragt:

am 21 Jan. 2024

Beantwortet:

am 21 Jan. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by