Code doesn't run.
显示 更早的评论
s = "Matlab rocks";
fprintf (s(3));
Index exceeds the number of array elements. Index must not exceed 1.
Error (line 2)
fprintf (s(3));
回答(1 个)
s = "Matlab rocks";
fprintf ('%s\n',s);
4 个评论
Kyara Christelle Riguerra
2022-3-24
s = "Matlab rocks";
s{1}(3)
s = "Matlab rocks";
sc = char(s) ;
sc(3)
Kyara Christelle Riguerra
2022-3-24
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!