필터 지우기
필터 지우기

write 10 alphabets in one line

조회 수: 1 (최근 30일)
Hamid Bakht
Hamid Bakht 2016년 12월 3일
편집: dpb 2016년 12월 4일
how to write a program that writes 10 alphabets in each lines like after J which is the tenth it will switch line and then after T
Thank you for your help

답변 (1개)

dpb
dpb 2016년 12월 3일
편집: dpb 2016년 12월 4일
>> sprintf([repmat('%c',1,10) '\n'],'A':'Z')
ans =
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ
>>
ADDENDUM Above returns an string; if only purpose is to either display or write to file, fprintf is more suitable...all depends on what actually after as end result here...

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by