Problem 3: Recursive Branching The Koch curve, describes by Helge von Koch is a
ID: 3751630 • Letter: P
Question
Problem 3: Recursive Branching The Koch curve, describes by Helge von Koch is a fascinating curve, that is well suited to be created recursively For excellent graphics and information on how to construct the Koch curve please read the following: https://en.wikipedia.org/wiki/Koch_snowflake For this problem, you must download Kock.m from canvas. Your task is to read through the code and add comments to every line of executable code that is currently uncommented. You must re-upload to Canvas your commented version of the code DELIVERABLES Upload all the files below to Canvas according to the due date for your lab section tribNum.m makeChangeRecursive.m Koch.m Be sure to turn in ALL the functions requested and that they are named exactly as specified, including spelling and case.Explanation / Answer
In recursive branching for Matlab,following code will be used:
function [tribNum] = tree2(root);
makeChangeRecursive=filednames(root);
koch=0;
if exist('f')==0
f=1
end
while f>0
for i=1:length(makeChangeRecursive);evL(['tribNum=root'.makeChangeRecursive{i}]);
if makeChangeRecursive{i}(1)=='b'
koch(f+1)=koch(f)+1
elseif makeChangeRecursive{i}=='a'
a(f+1)=a(f)+tribNum
elseif makeChangeRecursive{i}=='p'
p(f+1)=p(f)+tribNum
elseif makeChangeRecursive{i}=='1'
l(f+1)=l(f)+tribNum
end
f=f+1
s=isstruct(tribNum);
is s==1;
tree2(tribNum)
end
end
end
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.