Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need Help writing a main script MATLAB CODE function [x,y,z] = cylinder2(profile,AxisVals,NumChords,UseAxis) % Like the built-in function cylinder, but with specification of the values %

Need Help writing a main script MATLAB CODE

image text in transcribed

image text in transcribed

function [x,y,z] = cylinder2(profile,AxisVals,NumChords,UseAxis) % Like the built-in function cylinder, but with specification of the values % of the axis points along which the profile is to be plotted. If called % with only the profile argument, this will be identical to cylinder, using % axis values from 0 to 1. If AxisVals is specified, it must be of the same % length as profile. NumChords is the number of azimuthal points about the % axis to use (default 17). If UseAxis is specified, it is a string with % values 'x', 'y', or 'z' (default) and that axis will be used as the axis % along which the profile is plotted.

% cyl defaults if (nargin

az = linspace(0,2*pi,NumChords); % azimuth for zind = 1:length(AxisVals) x(zind,:) = profile(zind)*cos(az); y(zind,:) = profile(zind)*sin(az); z(zind,:) = AxisVals(zind)*ones(size(x(zind,:))); end

% take care of 'x' or 'y' axis profiles if (UseAxis=='x') temp = x; x = z; z = temp; elseif (UseAxis=='y') temp = y; y = z; z = temp; end

% if the output arguments aren't given, plot if (nargout==0) surf(x, y, z); end

function [x, y,z] - cylinder2 (profile, AxisVals, NumChords, UseAxis) % Like the built-in function cylinder, but with specification of the values % of the axis points along which the profile is to be plotted. If called % with only the profile argument, this will be identical to cylinder, using % axis values from 0 to I. If Axisvals is specified, it must be of the s % length as profile. NumChords is the number of azimuthal points about the % axis to use (default 17). If UseAxis is specified, it is a string with % values 'x', 'y', or 'z' (default) and that axis will be used as the axis % along which the profile is plotted. cyl defaults if (nargin

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions

Question

=+5. What is your impression of the Carbon Principles?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago