I want to transfer strings in an array to another array
显示 更早的评论
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 个评论
Birdman
2018-1-6
What is BoxA?
Jan
2018-1-6
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!