I want to transfer strings in an array to another array
Show older comments
I am trying to transfer strings of words in an array to another array if I define that word as 1. Here is my code atm. prompt = 'Define'; AB1=0; for aa = 1:BoxA wordsA(aa) AA(aa)=input(prompt) %state 1/0 depending if AA(aa) == 1 %if statement if 1 so it goes to another array AB1+1; wordsAB(AB1)=wordsA(aa) end end I get an error saying "Subscript indices must either be real positive integers or logicals." I can't find a tag or solution relating to this.
2 Comments
Birdman
on 6 Jan 2018
What is BoxA?
Jan
on 6 Jan 2018
What is a "string of words"? What does "transfer" mean? Please read Format code to make your code readable. Please post the complete error message, such that the readers do not have to guess in which lines the problem occurs.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!