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.
Test for balanced parentheses
Check if number exists in vector
Find nth maximum
Back to basics - mean of corner elements of a matrix
Connect Four Win Checker
Select every other element of a vector
Read a column of numbers and interpolate missing data
Return the 3n+1 sequence for n
Find the treasures in MATLAB Central and discover how the community can help you!
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