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

  Creates an object from the person class

Which of the following creates an object from the Person class?

  Program that prompts the user to enter the mass of a person

Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds.

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Program to load the data creating a sorted linked list

A Fully Documented Program to load the data creating a sorted linked list. A Test Plan to show how the program runs and can be executed

  Prepare calculator application - mock objects for testing

Which other classes do you think will need to be stubbed with mock objects for testing the application? For each class you identify explain why you think that class needs mocking and at least three di erent mocked behaviours you will need.

  Write a program that explores the seating patterns

Write a program that explores the seating patterns related to course performance by using an array of student scores. The program should do the following: Draw a seating chart of the classroom

  Use the arduino to make resistance meter

"use the arduino to make resistance meter. this should allow the user to plug a resistor into the breadboard and tell them what the resistance is"

  Write application for university admissions office

Write an application for a university admissions office. Prompt the user for a student's High School Grade Point (for example 3.2) and an admission test score (value from 0 to 100).

  Write a perl program

Write perl program which will run on my system and will start another perl program on another linux system. The main program should wait for linux perl program to complete its work and send the result to my main perl program.

  Store a list of items on a grocery list

write a program that uses a string array to store a list of items on a grocery list. The program should allow the user (via a menu) to add an item to the list, clear the list, and display the list.

  A class method to initialize class data members.

Sales class data members for a char letter input from the console, a double to hold each individual sale as it is entered and a double for each of the individual salesperson's total commission.

  What is code reuse

What is code reuse. How does inheritance help achieve code reuse

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