You are on page 1of 2

11 Program for different ways of arrays creation In MATLAB.

12 Program for different types of matrix and array operations In MATLAB.

13 Evaluate Multiple Conditions in Expression.

14 Expressions that include relational operators on arrays, such as A > 0,


are true only when every element in the result is nonzero.

15 Create a function for finding the maximum in a vector.

16 Explain different types of Loops in MATLAB.

17 Write a program for switch cases in MATLAB.

18 Write a program for converting Fahrenheit to Celsius.

19 Write a program for factorial calculation in MATLAB.

20 Write a program for displaying bar plot in MATLAB.


11. Program for different ways of arrays creation In MATLAB.
a = [1 2 3 4]

Output:
a = 1×4

1 2 3 4

To create a matrix that has multiple rows, separate the rows with semicolons.

a = [1 3 5; 2 4 6; 7 8 10]

Output:

a = 3×3

1 3 5
2 4 6
7 8 10

Another way to create a matrix is to use a function, such as ones, zeros, or rand. For
example, create a 5-by-1 column vector of zeros.
z = zeros(5,1)

Output:

z = 5×1

0
0
0
0
0

You might also like