Note : There is no MATLAB function which calculates surface area of the surface directly over any plane.However,it can be
calculated by splitting the rectangular or square grids into triangular pieces and adding them together.
Solution : If the coordinates of the vertices of triangle in three-dimensional space are given by Vi=(Xi,Yi,Zi), then area can be calculated by ;
Area(A) = 1/2* |(v2-v1) (v3-v1)|
Similarly,
SURFACE AREA OF f(x,y) :
[x,y] = peaks;
[m,n] = zeros(z);
area = 0;
for i = 1:m-1
for j = 1:n-1
v0 = [x(i,j) y(i,j) ];
v1 = [x(i,j+1) y(i,j+1) ];
v2 = [x(i+1,j) y(i+1,j)];
v3 = [x(i+1,j+1) y(i+1,j+1)];
a = v1 - v0;
b = v2 - v0;
c = v3 - v0;
A = 1/2*(norm(cross(a, c)) + norm(cross(b, c)));
area = area + A;
end
end
fprintf('\n Total area is: %f\n\n', area);
Write a MATLAB script that computes the surface area of a function
Write a matlab script(using only matlab) for this.
Write a script to solve the following problem: Ask the user for the length and the width of a rectangle. These need to be passed to a function. The function is to calculate and return the area and the perimeter of the rectangle. The area is the length times the width and the perimeter is 2 times the length and 2 times the width. Make sure to suppress all output from the...
write it in matlab language
Question No 4 6 Marks The surface area and volume of the shown ring-shaped mechanical part are calculated respectively as follows: A =rd (2k +d) V = *d? (2R +d) Write a user defined function that computes surface area (A) and volume (V) of this ring from the arguments d and R. Suppose that is constrained to be 15 in, greater than d. Write a script file that uses your function to plot A and...
Write a MATLAB script to plot the function of f(x) given by:
Write a MATLAB script to plot the function of f(x) given by: f(x) = integral x^2 - pi^2/4 x > pi/2 8 * cos x -pi/2 lessthanorequalto x lessthanorequalto pi/2 pi^2/4 - x^2 x < -pi/2
In Matlab
Prepare a script to plot the surface plot of the function Plot over the ranges -10 s x 3 10 and-20 sy 20. Note: The function, meshgrid) will need to be used to get the required matrices needed for x and y
matlab
The Homework should be submitted as a script (.m) file Write a script areaMenu that will print a menu consisting of "Cylinder," "Circle," and "Rectangle." It waits for the user to choose from the menu then call the corresponding function of each choice as follows: 1- Cylinder will call the function (cyl) which prompts the user for the radius and height of the cylinder, then calculates and prints area of the cylinder. 2- Circle will call the function (cir)...
MATLAB- Write a function that prints the area Write a function that prints the area and circumference of a circle for a given radius. Only the radius is passed to the function. The function does not return any values. The area is given by π r2 and the circumference is 2 π r.
Write a MATLAB script that loads and displays each of the captured images. Publish the MATLAB script output as a .docx file. For compactness purposes, show all five waveforms for each case on the same figure using MATLAB subplots. Use the legend function in MATLAB to add appropriate labeling to the subplots to ensure that the Figure legend can be written succinctly.
In matlab code
The body surface area (BSA) of a person (used for determining dosage of medications) can be calculated by the following formula: BSA = 0.007184 W^0.425 H^0.75 Write one script file to set up the problem and call all your functions. Write an anonymous function named P3anon that calculates the BSA whose input arguments are W and H. Write a function file named P3file that calculates the BSA whose input arguments are W and H. Use both your...