SlideShare a Scribd company logo
1 of 2
11/8/2015 Lab1
file:///Users/Revolver/School/F15/ME105/Lab1/html/Lab1.html 1/2
clc
%----------------------------------------
% Program: Lab1.m
% Author: Carlos Pereyra
%----------------------------------------
%%Problem 1.4
% Program Purpose:
% Determine how long (in Minutes, Hour, Seconds, and Years)
% it takes to travel 93x10^6 miles going 0.2 mile/min
clc
v=1/5; %(mile/min)
x=93*(10^6); %(mile)
tMin=x/v; %Minutes to the sun
tHour=tMin/60; %Hours to the sun
tSec=tMin*60; %Seconds to the sun
tYear=tHour*(1/24)*(1/365);
fprintf('It takes this long to get to the sunnn')
fprintf('t: %2.0f (Minutes)n',tMin)
fprintf('t: %2.0f (Hour)n',tHour)
fprintf('t: %2.0f (Second)n',tSec)
fprintf('t: %2.0f (Years)n',tYear)
It takes this long to get to the sun
: 465000000 (Minutes)
: 7750000 (Hour)
: 27900000000 (Second)
: 885 (Years)
%%Problem 1.17
% Program Purpose:
% Determine the equivelent resistance of two parellel
% resistors R1, and R2. These values are stored in the
% lists r1, and r2.
clc
r1=[100e3,100e3,100e3];
r2=[100e3,1,10e6];
abc=['a','b','c'];
N=2;
for R=0:N
Rinv=1/(r1(R+1))+1/(r2(R+1));
Ru=1/(Rinv);
rA=r1(R+1);
rB=r2(R+1);
letter=abc(R+1);
fprintf('part %s.)n',letter)
11/8/2015 Lab1
file:///Users/Revolver/School/F15/ME105/Lab1/html/Lab1.html 2/2
fprintf(' R1 t R2 ttReqtUnitsn')
fprintf('======t ========t======t=====n')
fprintf('%5.0ft %6.0f t%5.0ft(ohms) n',rA,rB,Ru)
fprintf('n')
end
part a.)
R1 R2 Req Units
====== ======== ====== =====
100000 100000 50000 (ohms)
part b.)
R1 R2 Req Units
====== ======== ====== =====
100000 1 1 (ohms)
part c.)
R1 R2 Req Units
====== ======== ====== =====
100000 10000000 99010 (ohms)
Published with MATLAB® R2015a

More Related Content

Viewers also liked

apls-68-07-758-776-LFRS-2014
apls-68-07-758-776-LFRS-2014apls-68-07-758-776-LFRS-2014
apls-68-07-758-776-LFRS-2014Peter J. Larkin
 
Cuestionario sobre el despegue de la Europa moderna
Cuestionario sobre el despegue de la Europa modernaCuestionario sobre el despegue de la Europa moderna
Cuestionario sobre el despegue de la Europa modernajcrojo
 
Cuestionario. Cambio técnico e innovación durante la Revolución Industrial
Cuestionario. Cambio técnico e innovación durante la Revolución IndustrialCuestionario. Cambio técnico e innovación durante la Revolución Industrial
Cuestionario. Cambio técnico e innovación durante la Revolución Industrialjcrojo
 
Executive Jet Letter of Recommendation
Executive Jet Letter of RecommendationExecutive Jet Letter of Recommendation
Executive Jet Letter of RecommendationDebbie Hughes
 
Letter of Recommendation Medical Director Department of Mental Health
Letter of Recommendation Medical Director Department of Mental HealthLetter of Recommendation Medical Director Department of Mental Health
Letter of Recommendation Medical Director Department of Mental HealthDebbie Hughes
 
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...Luxoft Education Center
 
Проектирование защищенных центров обработки данных Cisco.
Проектирование защищенных центров обработки данных Cisco. Проектирование защищенных центров обработки данных Cisco.
Проектирование защищенных центров обработки данных Cisco. Cisco Russia
 
Инфографика. Cisco Connected Mobile Experiences
Инфографика. Cisco Connected Mobile ExperiencesИнфографика. Cisco Connected Mobile Experiences
Инфографика. Cisco Connected Mobile ExperiencesCisco Russia
 
Краткий обзор Cisco TrustSec
Краткий обзор Cisco TrustSecКраткий обзор Cisco TrustSec
Краткий обзор Cisco TrustSecCisco Russia
 

Viewers also liked (11)

apls-68-07-758-776-LFRS-2014
apls-68-07-758-776-LFRS-2014apls-68-07-758-776-LFRS-2014
apls-68-07-758-776-LFRS-2014
 
Cuestionario sobre el despegue de la Europa moderna
Cuestionario sobre el despegue de la Europa modernaCuestionario sobre el despegue de la Europa moderna
Cuestionario sobre el despegue de la Europa moderna
 
Accident fly
Accident flyAccident fly
Accident fly
 
Cuestionario. Cambio técnico e innovación durante la Revolución Industrial
Cuestionario. Cambio técnico e innovación durante la Revolución IndustrialCuestionario. Cambio técnico e innovación durante la Revolución Industrial
Cuestionario. Cambio técnico e innovación durante la Revolución Industrial
 
Executive Jet Letter of Recommendation
Executive Jet Letter of RecommendationExecutive Jet Letter of Recommendation
Executive Jet Letter of Recommendation
 
Fusion recommendation letter
Fusion recommendation letter  Fusion recommendation letter
Fusion recommendation letter
 
Letter of Recommendation Medical Director Department of Mental Health
Letter of Recommendation Medical Director Department of Mental HealthLetter of Recommendation Medical Director Department of Mental Health
Letter of Recommendation Medical Director Department of Mental Health
 
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...
Александр Орлов, выступление на DEV Labs 2010 в Киеве про ожидания менеджеров...
 
Проектирование защищенных центров обработки данных Cisco.
Проектирование защищенных центров обработки данных Cisco. Проектирование защищенных центров обработки данных Cisco.
Проектирование защищенных центров обработки данных Cisco.
 
Инфографика. Cisco Connected Mobile Experiences
Инфографика. Cisco Connected Mobile ExperiencesИнфографика. Cisco Connected Mobile Experiences
Инфографика. Cisco Connected Mobile Experiences
 
Краткий обзор Cisco TrustSec
Краткий обзор Cisco TrustSecКраткий обзор Cisco TrustSec
Краткий обзор Cisco TrustSec
 

Recently uploaded

Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)ChandrakantDivate1
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORINTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORTanishkaHira1
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsMFatihSIRA
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfthietkevietthinh
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdfKamal Acharya
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptamrabdallah9
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxhublikarsn
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 

Recently uploaded (20)

Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSORINTERRUPT CONTROLLER 8259 MICROPROCESSOR
INTERRUPT CONTROLLER 8259 MICROPROCESSOR
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Compressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI ApplicationsCompressing and Sparsifying LLM in GenAI Applications
Compressing and Sparsifying LLM in GenAI Applications
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Danikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdfDanikor Product Catalog- Screw Feeder.pdf
Danikor Product Catalog- Screw Feeder.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Passive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.pptPassive Air Cooling System and Solar Water Heater.ppt
Passive Air Cooling System and Solar Water Heater.ppt
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 

Lab1

  • 1. 11/8/2015 Lab1 file:///Users/Revolver/School/F15/ME105/Lab1/html/Lab1.html 1/2 clc %---------------------------------------- % Program: Lab1.m % Author: Carlos Pereyra %---------------------------------------- %%Problem 1.4 % Program Purpose: % Determine how long (in Minutes, Hour, Seconds, and Years) % it takes to travel 93x10^6 miles going 0.2 mile/min clc v=1/5; %(mile/min) x=93*(10^6); %(mile) tMin=x/v; %Minutes to the sun tHour=tMin/60; %Hours to the sun tSec=tMin*60; %Seconds to the sun tYear=tHour*(1/24)*(1/365); fprintf('It takes this long to get to the sunnn') fprintf('t: %2.0f (Minutes)n',tMin) fprintf('t: %2.0f (Hour)n',tHour) fprintf('t: %2.0f (Second)n',tSec) fprintf('t: %2.0f (Years)n',tYear) It takes this long to get to the sun : 465000000 (Minutes) : 7750000 (Hour) : 27900000000 (Second) : 885 (Years) %%Problem 1.17 % Program Purpose: % Determine the equivelent resistance of two parellel % resistors R1, and R2. These values are stored in the % lists r1, and r2. clc r1=[100e3,100e3,100e3]; r2=[100e3,1,10e6]; abc=['a','b','c']; N=2; for R=0:N Rinv=1/(r1(R+1))+1/(r2(R+1)); Ru=1/(Rinv); rA=r1(R+1); rB=r2(R+1); letter=abc(R+1); fprintf('part %s.)n',letter)
  • 2. 11/8/2015 Lab1 file:///Users/Revolver/School/F15/ME105/Lab1/html/Lab1.html 2/2 fprintf(' R1 t R2 ttReqtUnitsn') fprintf('======t ========t======t=====n') fprintf('%5.0ft %6.0f t%5.0ft(ohms) n',rA,rB,Ru) fprintf('n') end part a.) R1 R2 Req Units ====== ======== ====== ===== 100000 100000 50000 (ohms) part b.) R1 R2 Req Units ====== ======== ====== ===== 100000 1 1 (ohms) part c.) R1 R2 Req Units ====== ======== ====== ===== 100000 10000000 99010 (ohms) Published with MATLAB® R2015a