Problem with string assembly
Show older comments
Hy all for my code,
V_AA = [100; 200]
L_AA = length(V_AA)
S_AA = num2str(V_AA)
for i=1:L_AA
F_AA{i} = ['N°: ' S_AA(i)];
end
i'm unable to get :
F_AA{1} = N°: 100
F_AA{2} = N°: 200
Thanks
Accepted Answer
More Answers (1)
Geoff Hayes
on 14 Aug 2016
Judy - since S_AA is an array of characters, then
S_AA(i)
returns the first character only in the ith row. To return all characters, you would need to do
for i=1:L_AA
F_AA{i} = ['N°: ' S_AA(i,:)];
end
1 Comment
judy abbott
on 14 Aug 2016
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!