Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need some help with this lab! I have bits and pieces done for each section, but I am just really stuck. Anything helps! %% Exercise
Need some help with this lab! I have bits and pieces done for each section, but I am just really stuck. Anything helps! %% Exercise 1 % NOTE: Please suppress output--i.e., use a semicolon ';' at the end of any % commands for which the output is not necessary to answer the question. % Delete these notes before turning in. % Define input variable theta as discretized row vector (i.e., array). theta = ??; % Define radius. r = ??; % Define x and y in terms of theta and r. x = ??; y = ??; % Check that x and y satisfy the equation of a circle. %% % Explain results here. Do x and y satisfy the equation of a circle? Why or % why not? How does the vector output at the end confirm your answer? % Notice I did not include text in the same line where the double-comment % is. What this accomplishes is it does not add a title or create a new % section in the table of contents when you publish. Using single % % starting in the line after the %% turns the comments black as opposed to % green. %% Exercise 2 % Define t-vector. t = ??; % Define y-vector. %% % Part (a) % Plot results (should have 3 plots total). figure; plot(??); title('??') %% % Part (b) % Plot results as data points only and as data points with line. figure; % creates a new figure window for next plot plot(??); title('??') figure; % creates another figure window plot(??); title('??') %% Exercise 3 % Create t-vector (choose enough elements so that plot is smooth!) t = ??; % Define x,y,z components in terms of t. x = ??; y = ??; z = ??; % Plot resuls. figure; % NOTE: if graph does not look smooth, use more elements in your % t-vector--i.e., use smaller stepsize between elements. Delete these notes % before submission. %% Exercise 4 % Define input variable as vector. x = ??; % Define y and z. y = ??; z = ??; % Plot results. figure; plot(??) axis tight; grid on; %% Exercise 5 % NOTE: you must create the M-file ex5.m separately and invoke it here in % your main M-file (main file). % Print out the code for your created M-file (do NOT submit M-file % separately). type 'ex5.m' % Run your M-file--i.e., execute the M-file. run 'ex5.m' %% Exercise 6 % For part (b), you need to create a separate M-file (f.m) and invoke it in % the main file, here. Erase these notes upon submission. %% % Part (a) % Define f as anonymous function. f = @(x,y)(??); % Evaluate f at the given values of x and y %% % Part (b) % Clear the function f out of the workspace. % Print out f.m contents. type 'f.m' % Evaluate f at the given values of x and y %% The End!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started