How and when to use sprintf disp ?....
이전 댓글 표시
Hi guys, I m italian (excuse me for my english) and I have a question about sprintf (disp,..):
My code is :
for k=1:1:Matrice_Gruppi(1, end)
c1={nomi_famiglie};
c2={Matrice_Gruppi(5, k)};
sprintf('\n %s paga %s euro.',c1{1},c2{1});
end
I simply would
- Insert with keybord a string and to save it into nomi_famiglie then
- To print values of nomi_famiglie and Matrice_Gruppi on command window (inizially, then I would create a interface).
I see the error:
Undefined function or variable 'sprinf'.
Could you help me please?
Thanks and bye
댓글 수: 4
for k=1:1:Matrice_Gruppi(1, end)
c1={nomi_famiglie};
c2={Matrice_Gruppi(5, k)};
sprintf('\n %s paga %s euro.',c1{1},c2{1});
end
What is the point in making c1 and c2 cell arrays, when on the very next line you take the data out of the cells? The cell arrays are totally superfluous, and only serve to confuse.
Also, what does this do?:
for k=1:1:Matrice_Gruppi(1,end)
Does the first row of Matrice_Gruppi contain an enumeration?
Luca
2017년 8월 16일
Stephen23
2017년 8월 16일
@Luca Filippone: I think you should be using
for k = 1:numel(Matrice_Gruppi)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 String에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
