New user question on fprintf
古いコメントを表示
Hey, i'm a new user to Matlab and am working on some homework. I'm trying to figure out how to write a script that will prompt the user to input a character and then perform the following actions.
A. use fprintf to print the character without specifying a field width
B. use fprintf to print the character specifying a field width of 5
My code I've been working on is below, you can see my mistakes.
% Prompt user to enter character
disp ('Please enter a character...any character')
%STRvar = input('Please enter a character', 's')
%fprintf (' var1 is %3.1s/')
%character = input(' Enter a character: ', 's');
fprintf ('The character %d has no specified field width\n')
If anyone could help me it'd be appreciated, thanks!
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Whos についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!