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.
convert matrix to single column
Matlab Basics - y as a function of x
Make a Palindrome Number
What is the next step in Conway's Life?
DNA N-Gram Distribution
Return the largest number that is adjacent to a zero
Find the numeric mean of the prime numbers in a matrix.
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