How can I access char elements from the beginning up to some fixed index of the char?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
a = char(abdefghijk);
I want the output 'abcdefg'
0 Commenti
Risposta accettata
Più risposte (2)
Vikram Ojha
il 7 Dic 2022
Modificato: Vikram Ojha
il 7 Dic 2022
>> 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
Vedere anche
Categorie
Scopri di più su Operators and Elementary Operations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!