Preview

INTRODUCTION TO MATLAB

Good Essays
Open Document
Open Document
832 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
INTRODUCTION TO MATLAB
INTRODUCTION TO MATLAB
© Dr. James S. Kang, Professor, ECE Department, Cal Poly Pomona
Opening MATLAB
Start → Programs → MATLAB → R2010a → MATLAB R2010a

or double click on icon (
). Slightly different for different versions and operating systems. The MATLAB window opens up as shown below. Depending on Desktop options, the window looks different. Set the Current Folder on top of the screen.

Working on Command Window
We are demonstrating the use of Command Window by solving HW Problem 1.9
1.9 The diameter of a 26 AWG copper (conductivity = σ = 5.69 × 107 S/m) wire is 0.405mm.
Find the resistance of the copper wire when the length of the wire is

1

(a)  = 20m

(b)  = 200m (c)  = 2km

(d)  = 20km

Enter clear all; after >> as shown below.
>> clear all;

Clear all clears previously defined variables and start new. Then, type format compact;
>> format compact;

Format compact suppress extra blank line in the answers. If you want to restore extra blank line, type in format loose. Semicolon indicates the end of an instruction. If you want to see the answer, do not enter semicolon. Enter diameter, σ, length as follows:
>> d=0.405e-3;sigma=5.69e7;l=20;

The radius r is found by dividing the diameter by 2:
>> r=d/2 r =
2.0250e-004

The cross sectional area of the conductor is given by
>> A=pi*r^2
A =
1.2882e-007

The resistance is given by
>> R=l/(sigma*A)
R =
2.7285

To change the length to 200m, press up arrow (↑) several times to get to the line
>> d=0.405e-3;sigma=5.69e7;l=20;

Change 20 to 200 and press Enter:
>> d=0.405e-3;sigma=5.69e7;l=200;

Press arrow (↑) several times to get to the line
>> r=d/2

and press Enter. Repeat this procedure for A and R to get r =
2.0250e-004

2

>> A=pi*r^2
A =
1.2882e-007
>> R=l/(sigma*A)
R =
27.2846

Repeating the above procedure, calculate resistance values for  = 2km and  = 20km. Rather than using arrows (↑, ↓), it is easier to modify the code by creating MATLAB script.
Creating MATLAB Script
Click File → New →Script.

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Chem Lab

    • 333 Words
    • 2 Pages

    4. What is the length of a crystal of copper sulfate in millimeters that is 0.250 inches long?…

    • 333 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ECT122 W1 ILab 2

    • 302 Words
    • 2 Pages

    A conductor is made of materials that have little opposition to the flow of charge. A conductor is made of metals like copper, silver, aluminum or gold. These types of metals allows for the easy flow of electrons. Wires are made of these materials.…

    • 302 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    MATLAB: command line mode, M files, data input, formatting output, file I/O, random numbers, statistics, reducing, solving equations, n equations in n unknowns, 2- and…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    File Processing Commands

    • 354 Words
    • 2 Pages

    After typing the above command press A (Capital a). You will see the below output.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    54. To display the Envelopes and Labels dialog box, click Tools, point to this option, and then click Envelopes and Labels.…

    • 1234 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    8. Calculate the conduction velocity in meters/second by dividing the distance between R1 and R2 (0.1 m) by the time it took…

    • 427 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ECT122 Wk3 Assignment

    • 456 Words
    • 2 Pages

    1. Each of the following resistor combinations is connected as shown in figure 4.29. For each combination, calculate the total circuit resistance.…

    • 456 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Mat 201 Basic Statistics

    • 455 Words
    • 2 Pages

    1. In a poll, respondents were asked whether they had ever been in a car accident. 157 respondents indicated that they had been in a car accident and 117 respondents said that they had not been in a car accident. If one of these respondents is randomly selected, what is the probability of getting someone who has been in a car accident?…

    • 455 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    chapter 3 1

    • 253 Words
    • 5 Pages

    In the blank space beside each adjusting entry, enter the letter of the explanation A through F that most…

    • 253 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ECT122 W4 ILab 1

    • 284 Words
    • 2 Pages

    3. What other unit, other than mhos, can conductance be measured in? What is its symbol? Siemens, S…

    • 284 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    My conclusion is that the density of my piece of aluminum foil is 0.0016 cm thick.…

    • 195 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    write back the result to memory. The complete assembly program to compute the value of…

    • 27742 Words
    • 111 Pages
    Powerful Essays
  • Satisfactory Essays

    5. In process window select check syntax for checking the syntax shown in figure 5. After successful completion of check syntax generate syntax report in…

    • 419 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Ethics Exam

    • 1978 Words
    • 8 Pages

    Put your answers immediately following the question on a new row; use the space you need for an adequate short answer.…

    • 1978 Words
    • 8 Pages
    Good Essays
  • Good Essays

    MM1 simulation in Matlab

    • 884 Words
    • 4 Pages

    mm1 simulation in matlab clc;clear; ST_Idle=0; ST_Busy=1; EV_NULL=0; EV_Arrive=1; EV_Depart=2; EV_LEN=3; Q_LIMIT=1000000; % next_event _type=[]; % num_custs _delayed=[]; % num_delays _count=[]; % num_events=[]; % num_in _queue=[]; % server_status=[]; % area_num _in _queue=[]; % area_server _status=[]; % mean_interarrival=[]; % mean_service=[]; % clock=[]; % time_last _event=[]; % total_of _delays=[]; time_arrival=[]; time_next _event=zeros(1,EV_LEN); num_events=…

    • 884 Words
    • 4 Pages
    Good Essays

Related Topics