2_Junak_Blake_LABHW10B

2_Junak_Blake_LABHW10B - 0.0251 Steel = 0.0127 0.0115...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Blake Junak Section 2 function [D,Steel,Square,Steel_Square] = LABHW10B(p,l) %Blake Junak %Section 2 %This function will use nested loops to calculate each element of an array %and generate outputs with the same formatting and input values as for a %previous function. %Given p=55; l=10; E=[112,206,104]*10^9; %N/m^2 I=[6.987,7.745,7.020]*10^-6; %m^4 Equation=[]; for i=1:length(I) for j=1:length(E) Equation(i,j)= (p*l^3)/(3*E(j)*I(i)) end end display(Equation) %What will be displayed: Steel=Equation(:,2) Square=Equation(2,:) Steel_Square=Equation(2,2) end >> p=55%N p = 55 >> l=10%m l = 10 >> run('/Users/bjunak5/Documents/MATLAB/LABHW10B.m') Equation =
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
0.0234 0.0127 0.0252 0.0211 0.0115 0.0228 0.0233 0.0127
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0.0251 Steel = 0.0127 0.0115 0.0127 Square = 0.0211 0.0115 0.0228 Steel_Square = 0.0115 %Blake Junak %Section 2 %This script is designed to calculate a value of a function between a %certain range for the x and y variables. %Ranges x=-10:1:10; y=-15:1:15; Distortion=; for i=1:length(x); for j=1:length(y); Distortion(i,j)= (.5*x(i)^3+(1/3)*y(j)^3)*exp(1E-3*x(i)^2)*exp(1E-3*y(j)^2); end end Maximum_Distortion=max(Distortion(i,j)) [imax,jmax]=find(Distortion==Maximum_Distortion); x_value=x(imax) y_value=y(jmax) >> run('/Users/bjunak5/Documents/MATLAB/LABHW10B2.m') Maximum_Distortion = 2.2490e+03 x_value = 10 y_value = 15 >>...
View Full Document

This note was uploaded on 04/02/2012 for the course EGR 102 taught by Professor Hinds during the Spring '09 term at Michigan State University.

Page1 / 3

2_Junak_Blake_LABHW10B - 0.0251 Steel = 0.0127 0.0115...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online