Create a matrix the same size as omega

Assignment Help Programming Languages
Reference no: EM131231608 , Length:

Lab #1: Introduction to MATLAB

Lab objectives: At the end of this lab you should be able to
- Open MATLAB and setup a working directory
- Manipulate variables, vectors and matrices in MATLAB including indexing.
- Call built-in MATLAB functions
- Plot graphs using MATLAB with axis labels, legends, and title.
- Write MATLAB scripts and functions and call your function

Read the Introduction to MATLAB Handout on canvas, paying particular attention to how to index arrays and how to write functions.

Open a MATLAB script file and name it Lab1_YourName.m. Use this to enter every MATLAB command you execute in this lab. Do NOT use the command line interface, because you need to turn this m-file in with your submission.

Part#1: Variable Assignment:

1) Start your script file with a clear; close all; clc;

The first clears the workspace, the second closes all plot windows, and the third clears the command line screen.

2) Create a matrix called M1 that has the following elements

M1 =

 

 

17

11

5

9

 

10

13

7

6

 

4

18

2

16

Create a matrix called M2 which is the transpose of M1.

3) Create a vector called v3 which has one row and whose columns contain the elements 5,10,15..... 150 (there should be 30 columns in this vector).

4) Create a frequency vector called, omega which has one row and whose columns contain the elements 0.0, 0.02, 0.04, ..., 7.0 such that MATLAB does not print out the result in the command window. Ensure code is shown in M-File.

Show the results to your instructor and get sign-off. You can move ahead to the next step if the instructor is busy.

Part#2: Math functions and plotting:

In this section, use commands such that MATLAB does not print out results to the command window.

5) Create a matrix the same size as omega called, Volt_omega which has the values, 2+j*omega, in it for the values of omega created previously. Plot the magnitude response abs(Volt_omega) versus omega. Include a title of the form Magnitude response". Label the horizontal axis ‘Radian Frequency (\omega)' and the vertical axis 'abs(2+j\omega)'. Notice how MATLAB changes the \omega to the symbol ω.

6) Create variables Is =1E - 14, VT =26E-3, and a voltage vector that start at -5 volts, with a step size of 0.001, and stops at 2 volts.

Then calculate I = IsV/VT -1 , which is the equation governing the current through a diode relative to voltage applied across it. You should use the command "figure" to create a new plot window and then plot the current versus the voltage with an appropriate title, and axis labels.

7) Notice how the current explodes and there is not a good understanding of what is going on. Here we will scale the axis to a reasonable range of current (i.e. +/- 1A). In a new figure, plot I versus V again, the use the axis command to set the axes limits. axis([min_X max_X min_Y max_Y]) or axes([-5 2 -1 1]). Add a title and axis labels, by programming them in your m-file.

Show the results to your instructor and get sign-off. You can move ahead to the next step if the instructor is busy.

Part#3: M-files: Functions and Vector For-Loops.

The objective of this section is to write a function that calculates the I-V curve for a diode across different temperatures. The function will return a matrix of I-V curves, where the columns represent each temperature.

It is critical that you know when to use a "row-vector" or a "column-vector". Most problems with vector based loops arise when you think it is a row-vector and it is a column vector or vice versa. MATLAB will complain about a dimension mismatch.

8) Write a function, called diode I_V.m, that takes three inputs and returns two outputs. The first input will be a scalar constant for the reverse saturation current, Is. The second input will be a vector of voltages. The third input will be a vector of temperatures in degrees Kelvin.

The function should return a matrix, whose columns are the I-V curves at each temperature and return a temperature vector that is a copy of the input temperature.

The diode current equation is

I = I(qV/ekT -1)

Where q is the charge of an electron (1.6E-19 Coulombs/electron), k is Boltzmanns constant (1.38E-23 J/K or 8.62E-5 eV/K), and T is the temperature in degrees Kelvin. Use kT/q = 26mV at T=300 K to determine which version of k to use.

Notice, this is always an issue in semiconductors.

Be sure to add appropriate comments at the beginning of your function. See the example in the MATLAB introduction handout provided.

Inside your function define q and k appropriately.

9) Write a vector For-Loop that does the following.
- Before the for-loop, create a figure, and make sure MATLAB holds the plot. figure; hold on;

- Create a loop for each parameter in the magnitude vector. i.e. "for ii = 1:length(Temperature Variable)"

- Calculate the required I_V curve versus voltage for a given temperature.

Use either I_V(ii,:) or I_V(:,ii) to store each I-V curve. One will create a matrix whose columns are the I-V curve and the other will create a matrix whose rows are the I-V curve. Pick the right one.

Comment on what "ii" is doing in this section.

- Plot your newly calculated I-V column vector versus voltage inside the for-loop. Make sure each new column-vector plot is on the same graph.

- end your for-loop properly.

- Finally, label the x-axis, y-axis, include a title with your name in it, and scale the axes so the current range is +/- 1 Amp. For example, if your voltage variable is called "Volt", then axis([min(Volt) max(Volt) -1 1]) will give you the minimum and maximum values of the x-axis.

10) Call this function from the Lab1 M-File using the following parameters. Note: It is the location of the variable name in the function, and not the name that matters when passing parameters to a function.

V = [-5:.001:1.85]; %Applied voltage across diode

T = [10, 100, 300, 400]; %Temperature vector

Is = 1E-15; %Reverse bias saturation current

I_V_Data = diode_I_V(Is,V,T);

Notice we place a semicolon to not print result to command window.

Attachment:- code.rar

Verified Expert

In this assignment we have learn how to define any matrix, how to use those matrix to form or generate another. Using this concept we have generate plot for voltage versus current curve, plot diode. Details concept of all commands are as follow: PLOT, CLEAR ALL, CLOSE ALL, LENGTH, etc.

Reference no: EM131231608

Questions Cloud

Which company is doing better why or why not : Using the current ratio and debt ratios, discuss what conclusions you can make about each company's ability to pay current liabilities (debt). Support your conclusions. Which company is doing better, why or why not?
Has this perspective changed from the past : What are the implications of labeling human behaviors (and by extension, human beings) as normal or abnormal? What are some of the consequences of labeling in the workplace?
Check conditions of the implicit function theorem : Let x4y3 - ty + 2 = 3xt2 - x7, where x is a variable and y and t are parameters. Check whether the two conditions of the Implicit Function Theorem hold at point A = (1, 1, 1)
Customer service level could improve marketing mix : Explain how adjusting the customer service level could improve a marketing mix. Illustrate Discuss the life cycle of a product in terms of its probable impact on a manufacturer’s marketing mix.Illustrate using personal computers.
Create a matrix the same size as omega : EENG 330: Microelectronics - Create a frequency vector called, omega which has one row and whose columns contain the elements 0.0, 0.02, 0.04, ..., 7.0 such that MATLAB does not print out the result in the command window - Create a matrix the same ..
What additional land would california require to meet : Use the USDA Quick Stats service (http://quickstats.nass.usda.gov//) to compare the 2009 oat yields between New York and California. What additional land would California require to meet the same amount of oat production as New York?
How much of a role do you believe inheritance plays : In what way is Mr. Potts's usage of alcohol considered abuse? Do you believe that Mr. Potts's habits reflect alcoholism according to the DSM-IV? Why or why not? How much of a role do you believe inheritance plays in alcohol abuse?
What are the tax consequences of this distribution to chadco : What are the tax consequences of this distribution to ChadCo, SecondCo, and Arnold? [Hint: First compute ChadCo's current-year taxable income and then compute current- year E&P before reducing the E&P for the distribution.
State employment regulations apply to the employer : Which of the many federal and state employment regulations apply to the employer? Under the applicable laws, what are the employer's responsibilities to the employees? Please be sure to address each category of employee in your response. How would yo..

Reviews

inf1231608

10/6/2016 9:25:46 AM

I accept my mistake, thanks for correcting my program. I'm really impressed. actually i had very less time to complete the assignment that's why i was knowingly unknowingly worried. But you have made it fine now. everything is okay. good one.

zac1231608

10/5/2016 10:32:46 PM

you write "Please write down 200 words summery of how we used matlab how did it help and explanation of the functions we used" but summary is already 279 words. it includes explanation of the functions we used and how we used matlab. please check carefully ) I have corrected your program (function call program). you can check or run your original program, then you find there is something missing in steps. 2) summary is already 279 words (previously). it includes explanation of the functions we used and how we used matlab. 3) now it is 371. please check carefully.

len1231608

10/5/2016 4:45:36 AM

MATLAB I have finished part 1 and 2 and HALF of part 3. in this assignment, 1- I need you to complete the part 3 code with comments. 2- write a brief lab report of the lab on all parts as requested. The second file is what I have written so far. This assignment is VERY basic, and I have finished 90% of the work. It should not take you more than 2-3 hours to have the work done "last for loop code + report". I will give you 12 hours from now.

Write a Review

Programming Languages Questions & Answers

  Write pseudocode and flowchart for program

Write pseudocode and flowchart for program that will prompt the user for a number, prompt the user for an operator (+,-,*,/).

  Write program to compute integer remainder

Write program segments which accomplish each of the following:  Compute the integer part of quotient when integer a is divided by integer b.

  Write loop header to hold odd number between a range

Suppose the int variables i and result have been declared but not initialized. Write down for loop header, that is something of form.

  Produce the necessary instructions to swap the values

Assume variables x and y are stored in memory locations 100 and 101. Using machine language instructions from section 5.2.4, produce the necessary instructions to swap the values of x and y.

  Tools assist novice programmer to generate code

Structured English and gave to a novice programmer who used it to create code? If not, what other tools could be used to assist the novice programmer to generate code?

  Program in c# that simulates the operation of the turtle

Write a program in C# that simulates the operation of the turtle and implements a computerized sketchpad. Write several turtle graphics programs that draw interesting shapes to use for testing your program.

  Void function to display in nicely formated way

Write a void function display_exer() that display in a nicely formated way the eat members of an exerclass object. Pass the object to the function by reference.

  Create-implement program which creates exception

Create and implement a program which creates an exception class called StringTooLongException, designed to be thrown when string is discovered that has too many characters in it.

  Super call for constructor to allot value of attribute

We have given a super call, which does some work of constructor. Your code must complete constructor by allotting the value of g to gpa attribute.

  Creating form which analyzes poker hand entered by user

To observe behavior of Sub Procedures, draw a Form which analyzes a poker hand entered by user and displays the type of hand.

  Program for insertion sort and selection sort algorithms

Write a program involving the insertion sort, merge sort and selection sort algorithms.

  Calculate and display total fees and discount

Write a program to select type of student using an option button and capture total credit hours using a text box. Calculate and display total fees, discount (if any) and net total fees (after discount).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd