choosing between two array location
Mostrar comentarios más antiguos
my code works when my parced string reads thorugh and places the wanted string in cell 5 but the modify version that i am working on collects two items and places the one i need in cell5 and the unwanted in cell6 and it crashes my script after that.
crashes here due to two cells with data instead of one [] [] [] [] [5] [6] it i may prevent it before getting here from reading string in multiple cells better but after it does fix would be fine as well - im stuck
channel_digits = regexp(channel_data{channel_location}, '\d', 'match');
what may i add so it chooses information in cell5
5 comentarios
I do not undestand, what you are asking for. You are mentioning "strings", but I do not see a string in the question. Where does " [] [] [] [] [5] [6]" come from?
Please post a relevant part of the code together with some input data and an explanation of the wanted result.
Ihaveaquest
el 10 de Ag. de 2022
Editada: dpb
el 10 de Ag. de 2022
Jan
el 13 de Ag. de 2022
@Ihaveaquest: The problem gets less clear. It is unclear, what your inputs are and what you want to achieve. What is a "slot"? Again: Where does "[] [] [] [] [5] [6]" occur in your code? Just repeating this piece does not clarify anything. Which variable has this value?
Do you want the 5th cell element only, or the first matching variable, or its index?
Post some input data as Matlab code, which run by copy&paste, and explain exactly, what you want as output. I assume, then the solution is simple, e.g.:
match = contains(channel_data, channel_identifier);
channel = channel_data(find(match, 1));
Ihaveaquest
el 27 de Sept. de 2022
Rik
el 28 de Sept. de 2022
Please consider using interpunction when writing text. It really helps to understand what you write.
Is your question now solved? Or do you still have a problem?
Respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!