fprintf in if statement

10 views (last 30 days)
Ryan Allan
Ryan Allan on 21 Aug 2019
Commented: madhan ravi on 21 Aug 2019
Hi,
Is there a way to only fprintf data while using an if statement. For example, if x = 1, fprintf ('hello');
Thanks

Accepted Answer

madhan ravi
madhan ravi on 21 Aug 2019
Edited: madhan ravi on 21 Aug 2019
if x == 1 % where x is assumed as a scalar
fprintf('hello')
end
help if
doc if

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!