Does anyone know why this doesn't answer the problem? When worked out in matlab it works just fine.
1. do not use "input(...)", "n" is defined variable and input doesn't return anything. 2. "=" is used for assignments, not for comparisions. This one returns syntax error in line 3 (if ...), use "==" instead. 3. Output should be logical, not string. Use "false" instead of "'false'" etc. 4. Return the output via variable specified for it in first line of the function, in this case it is "tf". Do not use "fprintf" for that. 5. Read The Friendly Manual. Just type "doc" in Command Window - there are tons of documentation, tutorials.
L 3 (C 15): SYNER: Parse error at '=': usage might be invalid MATLAB syntax.
Find the two most distant points
Reverse the vector
Cell Counting: How Many Draws?
Celsius to Kelvin
Renaming a field in a structure array
Make a Palindrome Number
Who Has the Most Change?
It dseon't mettar waht oedrr the lrettes in a wrod are.
Which values occur exactly three times?
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office