what at the end of the line suppresses the echo - ANSWER ;
how would you make something print - ANSWER fprintf()
how would you say "Print this string" - ANSWER fprintf('Print this string')
how do you make the >> go on another line - ANSWER
if you wanted to print 'My name is Nadia Parsell' and wanted to make sure the >> was on
another line, how would you do that - ANSWER fprintf('My name is Nadia Parsell
')
where can you have the (
) - ANSWER anywhere
if you wanted to print 'First line' 'Second line' and 'Third line' on different lines how would
you do that - ANSWER fprintf('First line
Second line
Third line
')
how do you clear everything in your workspace - ANSWER clear all
, how do you clear the command window - ANSWER clc
if your script is not terminating, how would you manually stop it - ANSWER command +.
how do you create a multi-line comment - ANSWER %{This is a multi-line comment %}
How would you prompt the user for values or numbers - ANSWER input()
How would you prompt a user to input a number - ANSWER myNum=input('Enter a
number:')
how would you ask a user to input their age - ANSWER yourAge=input('Please enter
your age:')
By default what will the input be considered as - ANSWER A number
What would you have to do in order to force MATLAB to take the input as a string -
ANSWER Add ','s
how would you ask somebody to enter their name ANSWER yourName=input('Please
enter your name:','s')
when printing number. what is the difference between %d or %f ANSWER %f gives you 6
decimal places, %d just gives you the number you placed in
so if we had to code fprintf('%s %s %s
', 'first', 'second', 'third') how would you reorder it so that it goes from third second to
first - ANSWER fprintf('%3$s %2$s %1$s
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Easton. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $13.99. You're not tied to anything after your purchase.