Question
I have 5 inputs and 1 output for my ANN problem. Among the 5 inputs are 2 "text". One is name of manufacturer (3 unique) and the other is specimen exposure type (acid, alkaline, alkaline+salt, water). How should these text type input be modified to train the model?
Expert Answer
Neeta Dsouza
PhD Expert
Answered Aug 26, 2026
The easiest approach would be to convert the text values to numeric values before feeding to the ANN. For example,
exposure_types = {'acid', 'alkaline', 'alkaline+salt', 'water'};
and input data is something like this
inputs = {'acid', 'acid', 'acid', 'water', 'alkaline', 'acid', 'alkaline+salt'}
you can get an equivalent numeric form using ismember()
[~, inputs_numeric] = ismember(inputs, exposure_types);<?pre>
Result
>> inputs_numeric
inputs_numeric =
1 1 1 4 2 1 3
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related deep learning Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →