Font size
WorksheetsMATLAB
Total questions: 14
Worksheet time: 8mins
How to plot a graph in MATLAB
x : [value ofarray]
y : [value ofarray] plot(x, y)
x : [value ofarray];
y : [value ofarray]; plot(x, y)
x=[value ofarray];
y=[value ofarray]; plot(x, y)
x : [value ofarray]
y : [value ofarray] plot(x, y);
WHAT ARE THE SPECIAL MATRIX IN MATLAB
HILBERT MATRIX
HILBERT INVERSE MATRIX
PASCAL MATRIX
SQUARE MAGIC
TOEPLITZ MATRIX
VANDERMONDE MATRIX
EIGEN VALUE TEST MATRIX
SQUARE MATRIX
SOLVE('4-t^2=0')
(a)
A= 1 2 3
4 5 6
7 8 9
>>A(:,2)=[]
1 3
4 6
7 0
2 3
5 6
8 9
1 3
4 6
7 9
2 3
5 6
8 0
Command is used to save command window text to file
a) saveas
texttofile
diary
todiary
a = 1; sin(a) a = 2;
0.4815
0.8516
0.8415
0.4916
OUTPUT OF A = [0 1; 1 0] ; B=2 ; C = A + B
1 2
4 5
1 4
2 5
ERROR
1 2
5 4
What happens if we don’t assign a variable to an expression which evaluates a numerical value?
MATLAB shows error
values are assigned to a variable ans automatically
Depends on the numerical value
Nothing happens
What is the disadvantage of the whos function in MATLAB?
It does not show the name of the variable
It does not show the class of the variable
It does not show the size of the variable
It does not show the values of the variable
Vectors depend upon brackets while scalars don’t
TRUE
FALSE
OUTPUT OF A=[1 2 3..
];
1 2 3
A row vector concatenated with a null matrix
Error
The output is suppressed
Variables need to have same name while being passed from the primary function to the sub-function
TRUE
FALSE
FIND THE ERROR x=-10:1:10; y=-10:2:10; plot(x,y)
Length of x and y should be same
No error
Plot is not available in MATLAB
Plot x,y has no semicolon
What does the echo command do?
It shows the comments present in Script files
It shows the commands and comments in MAT-files
It echoes
It shows the commands and the comments in M-files
