33 views

Uploaded by pujan77

matlab

- matlab
- MATLAB
- Matlab Tutorial
- Matlab programming
- 1873036761.pdf
- Technical Specification Eng 02bmn e11-y11 09092015
- c3d.pdf
- Wh d 2016 Executive Director Message English
- 01.TOD Standard Final
- Basti Bikash Mapdanda 2072
- 2. Dr. Bhattarai, KUKL
- Overview of Regional Development in Malaysia-paper
- nep-regional-strategy-development.pdf
- PPA Amendment
- 150804095122-Doc
- A 284753
- Road Pavement Management Discussion Paper
- Specification
- CNAS_32_02_05.pdf
- WATER TANK

You are on page 1of 2

)

DEPARTMENT OF CIVIL ENGINEERING

IIT DELHI

MATLAB EXERCISE

(Available online at: http://web.iitd.ac.in/~sbhalla/cel331.htm)

1. Run MATLAB

2. Set working directory as DESKTOP using path browser.

3. Create a matrix A by typing A = [23, 45, 63] and another matrix B by B = [27,05,-13].

4. Produce C = A+B.

5. Multiply each element of C by 5.

6. How will you create a matrix of size m x n? Use the help menu of MATLAB. Also learn basic

matrix operations.

7. Create a text file containing numbers from 1 to 20, one on each line.

8. Read this file into a matrix “x” using MATLAB. To see syntax, type: “help dlmread” in the

command prompt.

9. Create another matrix “y” with each element equal to the square of each element of “x”. (HINT: use

for loop, you may type “help for” to see syntax)

10. Plot (x,y) {type “help plot” to see the syntax}

11. Save the plot, copy and paste it on word.

12. Save the matrix “y” on a text file (type: “help dlmwrite” for syntax).

13. Create a text file containing a 7x4 matrix, with all elements separated by “tab”. Import the matrix

“M” in MATLAB using “dlmread” command.

14. Learn how to transfer a matrix from MATLAB to EXCEL and vice versa.

15. Import first five elements of first two columns of the matrix “M” into variables “x” and “y”. Obtain

a plot of “x” vs “y”.

16. Create a set of numbers from 1 to 100 in a matrix A by : A = (1:100).

1 | P a g e

2 | P a g e

17. Write a program to plot f(t) = e

-at

sinωt, where the values of A and ω are provided by the user.

Choose a = 0.001 and ω = 3 and display the plot.

18. Learn the use of commands “ls” and “clear”.

19. Write a program in a separate file (abc.m) to obtain the derivative of function f(x) = 2x

2

+ 5x+3 at x

= 10.Compare the result with exact value. Can you directly determine the derivative using functions

already available in MATLAB?

20. Repeat exercise 19 by replacing differentiation by integration in range (x=10 to 20). Also use the

built-in functions of MATLAB.

- 1873036761.pdfUploaded bypujan77
- Technical Specification Eng 02bmn e11-y11 09092015Uploaded bypujan77
- c3d.pdfUploaded bypujan77
- Wh d 2016 Executive Director Message EnglishUploaded bypujan77
- 01.TOD Standard FinalUploaded byDivya Rath
- Basti Bikash Mapdanda 2072Uploaded byMishal Limbu
- 2. Dr. Bhattarai, KUKLUploaded bypujan77
- Overview of Regional Development in Malaysia-paperUploaded byShino Uchiha
- nep-regional-strategy-development.pdfUploaded bypujan77
- PPA AmendmentUploaded bypujan77
- 150804095122-DocUploaded bypujan77
- A 284753Uploaded byCJ
- Road Pavement Management Discussion PaperUploaded bypujan77
- SpecificationUploaded bypujan77
- CNAS_32_02_05.pdfUploaded bypujan77
- WATER TANKUploaded byVivek Gosavi
- 140516111911-DocUploaded bypujan77
- planUploaded bypujan77
- planUploaded bypujan77
- ScheduleUploaded bypujan77
- Calculus Cheat Sheet Limits Definitions Limit at Infinity :Uploaded byapi-11922418
- Staircase 2Uploaded bypujan77
- 0ea23d7544be856eec1185c980db9c3eUploaded bypujan77
- StudentDatabaseERDiagram_SchemaUploaded bypujan77
- GridUploaded bypujan77
- Rescuing Troubled ProjectsUploaded byarun-premier
- 1.ACI 318 Code Comparison With IS456-2000(1)Uploaded bytops123
- Project MezzanineUploaded bypujan77
- IS 800 : 1984Uploaded byGuru Prasad
- Trigonometry FormulasUploaded byyashar2500