How can I access char elements from the beginning up to some fixed index of the char?
Mostra commenti meno recenti
a = char(abdefghijk);
I want the output 'abcdefg'
Risposta accettata
Più risposte (2)
Vikram Ojha
il 7 Dic 2022
Modificato: Vikram Ojha
il 7 Dic 2022
1 voto
>> a='abcdefghijk'
>> a(1:5)
ans =
'abcde'
In genral a(1:n) % n for index
You can consider going through following doc: https://in.mathworks.com/help/matlab/ref/string.html, it will be helpful
In case you want you can take Matlab fundamental certification: https://matlabacademy.mathworks.com/details/matlab-fundamentals/mlbe
1 Commento
Daniel
il 7 Dic 2022
Steven Lord
il 7 Dic 2022
0 voti
Categorie
Scopri di più su Structures in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!